Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private string ExtractPropertyInfoType(PropertyInfo property)
- {
- var isNumber =
- property.PropertyType == typeof(sbyte) ||
- property.PropertyType == typeof(byte) ||
- property.PropertyType == typeof(char) ||
- property.PropertyType == typeof(short) ||
- property.PropertyType == typeof(ushort) ||
- property.PropertyType == typeof(int) ||
- property.PropertyType == typeof(uint) ||
- property.PropertyType == typeof(long) ||
- property.PropertyType == typeof(ulong);
- if (isNumber)
- {
- return "number";
- }
- if (property.PropertyType == typeof(string))
- {
- return "string";
- }
- if (property.PropertyType == typeof(DateTime))
- {
- return "Date";
- }
- return property.PropertyType.Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment