public static IProjectionDescription CreateStructPropertySelector(PropertyInfo property) { var funcType = typeof(Func <,>).MakeGenericType(property.GetGetMethod().GetParameters()[0].ParameterType, property.PropertyType); var selector = Delegate.CreateDelegate(funcType, property.GetGetMethod()); return(CodeGenerationContext.CreateStructFunction(selector)); }
public static IProjection <TSource, TResult> CreateStructFunction <TSource, TResult>(Func <TSource, TResult> selector) { return((IProjection <TSource, TResult>)CodeGenerationContext.CreateStructFunction((Delegate)selector)); }