-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTypeHelper.cs
More file actions
49 lines (43 loc) · 1.81 KB
/
TypeHelper.cs
File metadata and controls
49 lines (43 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
namespace Extensions
{
public static class TypeHelper
{
public static IDictionary<string, bool> BasicTypes()
{
IDictionary<string, bool> basicTypes = new Dictionary<string, bool>();
basicTypes[typeof (int).Name] = true;
basicTypes[typeof (long).Name] = true;
basicTypes[typeof (float).Name] = true;
basicTypes[typeof (double).Name] = true;
basicTypes[typeof (decimal).Name] = true;
basicTypes[typeof (sbyte).Name] = true;
basicTypes[typeof (Int16).Name] = true;
basicTypes[typeof (Int32).Name] = true;
basicTypes[typeof (Int64).Name] = true;
basicTypes[typeof (Double).Name] = true;
basicTypes[typeof (Decimal).Name] = true;
basicTypes[typeof (bool).Name] = true;
basicTypes[typeof (DateTime).Name] = true;
basicTypes[typeof (string).Name] = true;
return basicTypes;
}
public static IDictionary<string, bool> NumericTypes()
{
IDictionary<string, bool> numericTypes = new Dictionary<string, bool>();
numericTypes[typeof (int).Name] = true;
numericTypes[typeof (long).Name] = true;
numericTypes[typeof (float).Name] = true;
numericTypes[typeof (double).Name] = true;
numericTypes[typeof (decimal).Name] = true;
numericTypes[typeof (sbyte).Name] = true;
numericTypes[typeof (Int16).Name] = true;
numericTypes[typeof (Int32).Name] = true;
numericTypes[typeof (Int64).Name] = true;
numericTypes[typeof (Double).Name] = true;
numericTypes[typeof (Decimal).Name] = true;
return numericTypes;
}
}
}