Pomona.Common.TypeSystem.PropertySpec.OnLoadGetter C# (CSharp) Method

OnLoadGetter() protected method

protected OnLoadGetter ( ) : PropertyGetter
return PropertyGetter
        protected internal virtual PropertyGetter OnLoadGetter()
        {
            if (!PropertyInfo.CanRead)
                return null;
            var param = Expression.Parameter(typeof(object));
            return
                Expression.Lambda<Func<object, IContainer, object>>(
                    Expression.Convert(
                        Expression.Property(Expression.Convert(param, PropertyInfo.DeclaringType), PropertyInfo),
                        typeof(object)),
                    param,
                    Expression.Parameter(typeof(IContainer)));
        }

Usage Example

Example #1
0
 public virtual PropertyGetter LoadGetter(PropertySpec propertySpec)
 {
     if (propertySpec == null)
     {
         throw new ArgumentNullException(nameof(propertySpec));
     }
     return(propertySpec.OnLoadGetter());
 }
All Usage Examples Of Pomona.Common.TypeSystem.PropertySpec::OnLoadGetter