@@ -25,8 +25,8 @@ public ConvertToDateTimeGenerator()
25
25
{
26
26
SupportedMethods = new [ ]
27
27
{
28
- ReflectHelper . GetMethodDefinition < string > ( s => DateTime . Parse ( s ) ) ,
29
- ReflectHelper . GetMethodDefinition < string > ( o => Convert . ToDateTime ( o ) )
28
+ ReflectHelper . FastGetMethod ( DateTime . Parse , default ( string ) ) ,
29
+ ReflectHelper . FastGetMethod ( Convert . ToDateTime , default ( string ) )
30
30
} ;
31
31
}
32
32
}
@@ -38,8 +38,8 @@ public ConvertToBooleanGenerator()
38
38
{
39
39
SupportedMethods = new [ ]
40
40
{
41
- ReflectHelper . GetMethodDefinition < string > ( s => Boolean . Parse ( s ) ) ,
42
- ReflectHelper . GetMethodDefinition < string > ( o => Convert . ToBoolean ( o ) )
41
+ ReflectHelper . FastGetMethod ( bool . Parse , default ( string ) ) ,
42
+ ReflectHelper . FastGetMethod ( Convert . ToBoolean , default ( string ) )
43
43
} ;
44
44
}
45
45
}
@@ -49,24 +49,24 @@ public class ConvertToInt32Generator : ConvertToGenerator<int>
49
49
public ConvertToInt32Generator ( )
50
50
{
51
51
SupportedMethods = new [ ]
52
- {
53
- ReflectHelper . GetMethodDefinition < string > ( s => int . Parse ( s ) ) ,
54
- ReflectHelper . GetMethodDefinition < bool > ( o => Convert . ToInt32 ( o ) ) ,
55
- ReflectHelper . GetMethodDefinition < byte > ( o => Convert . ToInt32 ( o ) ) ,
56
- ReflectHelper . GetMethodDefinition < char > ( o => Convert . ToInt32 ( o ) ) ,
57
- ReflectHelper . GetMethodDefinition < decimal > ( o => Convert . ToInt32 ( o ) ) ,
58
- ReflectHelper . GetMethodDefinition < double > ( o => Convert . ToInt32 ( o ) ) ,
59
- ReflectHelper . GetMethodDefinition < float > ( o => Convert . ToInt32 ( o ) ) ,
60
- ReflectHelper . GetMethodDefinition < int > ( o => Convert . ToInt32 ( o ) ) ,
61
- ReflectHelper . GetMethodDefinition < long > ( o => Convert . ToInt32 ( o ) ) ,
62
- ReflectHelper . GetMethodDefinition < object > ( o => Convert . ToInt32 ( o ) ) ,
63
- ReflectHelper . GetMethodDefinition < sbyte > ( o => Convert . ToInt32 ( o ) ) ,
64
- ReflectHelper . GetMethodDefinition < short > ( o => Convert . ToInt32 ( o ) ) ,
65
- ReflectHelper . GetMethodDefinition < string > ( o => Convert . ToInt32 ( o ) ) ,
66
- ReflectHelper . GetMethodDefinition < uint > ( o => Convert . ToInt32 ( o ) ) ,
67
- ReflectHelper . GetMethodDefinition < ulong > ( o => Convert . ToInt32 ( o ) ) ,
68
- ReflectHelper . GetMethodDefinition < ushort > ( o => Convert . ToInt32 ( o ) )
69
- } ;
52
+ {
53
+ ReflectHelper . FastGetMethod ( int . Parse , default ( string ) ) ,
54
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( bool ) ) ,
55
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( byte ) ) ,
56
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( char ) ) ,
57
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( decimal ) ) ,
58
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( double ) ) ,
59
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( float ) ) ,
60
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( int ) ) ,
61
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( long ) ) ,
62
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( object ) ) ,
63
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( sbyte ) ) ,
64
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( short ) ) ,
65
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( string ) ) ,
66
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( uint ) ) ,
67
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( ulong ) ) ,
68
+ ReflectHelper . FastGetMethod ( Convert . ToInt32 , default ( ushort ) )
69
+ } ;
70
70
}
71
71
}
72
72
@@ -75,23 +75,23 @@ public class ConvertToDecimalGenerator : ConvertToGenerator<decimal>
75
75
public ConvertToDecimalGenerator ( )
76
76
{
77
77
SupportedMethods = new [ ]
78
- {
79
- ReflectHelper . GetMethodDefinition < string > ( s => decimal . Parse ( s ) ) ,
80
- ReflectHelper . GetMethodDefinition < bool > ( o => Convert . ToDecimal ( o ) ) ,
81
- ReflectHelper . GetMethodDefinition < byte > ( o => Convert . ToDecimal ( o ) ) ,
82
- ReflectHelper . GetMethodDefinition < decimal > ( o => Convert . ToDecimal ( o ) ) ,
83
- ReflectHelper . GetMethodDefinition < double > ( o => Convert . ToDecimal ( o ) ) ,
84
- ReflectHelper . GetMethodDefinition < float > ( o => Convert . ToDecimal ( o ) ) ,
85
- ReflectHelper . GetMethodDefinition < int > ( o => Convert . ToDecimal ( o ) ) ,
86
- ReflectHelper . GetMethodDefinition < long > ( o => Convert . ToDecimal ( o ) ) ,
87
- ReflectHelper . GetMethodDefinition < object > ( o => Convert . ToDecimal ( o ) ) ,
88
- ReflectHelper . GetMethodDefinition < sbyte > ( o => Convert . ToDecimal ( o ) ) ,
89
- ReflectHelper . GetMethodDefinition < short > ( o => Convert . ToDecimal ( o ) ) ,
90
- ReflectHelper . GetMethodDefinition < string > ( o => Convert . ToDecimal ( o ) ) ,
91
- ReflectHelper . GetMethodDefinition < uint > ( o => Convert . ToDecimal ( o ) ) ,
92
- ReflectHelper . GetMethodDefinition < ulong > ( o => Convert . ToDecimal ( o ) ) ,
93
- ReflectHelper . GetMethodDefinition < ushort > ( o => Convert . ToDecimal ( o ) )
94
- } ;
78
+ {
79
+ ReflectHelper . FastGetMethod ( decimal . Parse , default ( string ) ) ,
80
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( bool ) ) ,
81
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( byte ) ) ,
82
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( decimal ) ) ,
83
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( double ) ) ,
84
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( float ) ) ,
85
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( int ) ) ,
86
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( long ) ) ,
87
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( object ) ) ,
88
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( sbyte ) ) ,
89
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( short ) ) ,
90
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( string ) ) ,
91
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( uint ) ) ,
92
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( ulong ) ) ,
93
+ ReflectHelper . FastGetMethod ( Convert . ToDecimal , default ( ushort ) )
94
+ } ;
95
95
}
96
96
}
97
97
@@ -100,23 +100,23 @@ public class ConvertToDoubleGenerator : ConvertToGenerator<double>
100
100
public ConvertToDoubleGenerator ( )
101
101
{
102
102
SupportedMethods = new [ ]
103
- {
104
- ReflectHelper . GetMethodDefinition < string > ( s => double . Parse ( s ) ) ,
105
- ReflectHelper . GetMethodDefinition < bool > ( o => Convert . ToDouble ( o ) ) ,
106
- ReflectHelper . GetMethodDefinition < byte > ( o => Convert . ToDouble ( o ) ) ,
107
- ReflectHelper . GetMethodDefinition < decimal > ( o => Convert . ToDouble ( o ) ) ,
108
- ReflectHelper . GetMethodDefinition < double > ( o => Convert . ToDouble ( o ) ) ,
109
- ReflectHelper . GetMethodDefinition < float > ( o => Convert . ToDouble ( o ) ) ,
110
- ReflectHelper . GetMethodDefinition < int > ( o => Convert . ToDouble ( o ) ) ,
111
- ReflectHelper . GetMethodDefinition < long > ( o => Convert . ToDouble ( o ) ) ,
112
- ReflectHelper . GetMethodDefinition < object > ( o => Convert . ToDouble ( o ) ) ,
113
- ReflectHelper . GetMethodDefinition < sbyte > ( o => Convert . ToDouble ( o ) ) ,
114
- ReflectHelper . GetMethodDefinition < short > ( o => Convert . ToDouble ( o ) ) ,
115
- ReflectHelper . GetMethodDefinition < string > ( o => Convert . ToDouble ( o ) ) ,
116
- ReflectHelper . GetMethodDefinition < uint > ( o => Convert . ToDouble ( o ) ) ,
117
- ReflectHelper . GetMethodDefinition < ulong > ( o => Convert . ToDouble ( o ) ) ,
118
- ReflectHelper . GetMethodDefinition < ushort > ( o => Convert . ToDouble ( o ) )
119
- } ;
103
+ {
104
+ ReflectHelper . FastGetMethod ( double . Parse , default ( string ) ) ,
105
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( bool ) ) ,
106
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( byte ) ) ,
107
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( decimal ) ) ,
108
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( double ) ) ,
109
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( float ) ) ,
110
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( int ) ) ,
111
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( long ) ) ,
112
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( object ) ) ,
113
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( sbyte ) ) ,
114
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( short ) ) ,
115
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( string ) ) ,
116
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( uint ) ) ,
117
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( ulong ) ) ,
118
+ ReflectHelper . FastGetMethod ( Convert . ToDouble , default ( ushort ) )
119
+ } ;
120
120
}
121
121
}
122
122
}
0 commit comments