Code could be simplified.
Contents of constructor could be removed then:
|
static ValueOf() |
|
{ |
|
ConstructorInfo ctor = typeof(TThis) |
|
.GetTypeInfo() |
|
.DeclaredConstructors |
|
.First(); |
|
|
|
var argsExp = new Expression[0]; |
|
NewExpression newExp = Expression.New(ctor, argsExp); |
|
LambdaExpression lambda = Expression.Lambda(typeof(Func<TThis>), newExp); |
|
|
|
Factory = (Func<TThis>)lambda.Compile(); |
|
} |
Code could be simplified.
ValueOf/ValueOf/ValueOf.cs
Line 55 in 84e9e84
Contents of constructor could be removed then:
ValueOf/ValueOf/ValueOf.cs
Lines 28 to 40 in 84e9e84