Use Expression.Lambda
Closed this issue · 1 comments
JohanLarsson commented
internal static class PropertyInfoExt
{
internal static Func<TSource, TValue> CreateGetter<TSource, TValue>(this PropertyInfo property)
{
var parameter = Expression.Parameter(typeof(TSource));
return Expression.Lambda<Func<TSource, TValue>>(Expression.Property(parameter, property), parameter)
.Compile();
}
}
JohanLarsson commented
Done.