public static Expression<Func<TSource, TProperty>> GetGetAccessor<TSource, TProperty>(
this PropertyInfo propertyInfo,
bool includeNonPublic = false)
{
var getMethod = propertyInfo.GetGetMethod(includeNonPublic);
var instance = Expression.Parameter(typeof(TSource), "instance");
var value = Expression.Call(instance, getMethod);
return Expression.Lambda<Func<TSource, TProperty>>(
propertyInfo.PropertyType.IsValueType