Ejemplo n.º 1
0
        public object GetValue(object instance, PropertyInfo info)
        {
            var identity = new PropertyIdentity(instance.GetType(), info.Name);
            var getter   = CompiledPropertyInfo.GetGetter(identity);

            return(getter(instance));
        }
Ejemplo n.º 2
0
        public void SetValue(object instance, object value, PropertyInfo info)
        {
            var identity = new PropertyIdentity(instance.GetType(), info.Name);
            var setter   = CompiledPropertyInfo.GetSetter(identity);

            setter(instance, value);
        }
Ejemplo n.º 3
0
 private TypeCreator Create(Type item)
 {
     if (item.IsValueType)
     {
         var body = Expression.Convert(Expression.New(item), objectType);
         return(Expression.Lambda <TypeCreator>(body).CompileSys());
     }
     return(CompiledPropertyInfo.GetCreator(item));
 }