Exemple #1
0
 public object this[string property]
 {
     get
     {
         if (EntityCtx.IsNotNull())
         {
             EntityProperty c = EntityCtx.Properties.FirstOrDefault(prop => prop.Name == property);
             if (c.IsNotNull())
             {
                 return(c.Getter(this));
             }
             return(null);
         }
         return(null);
     }
     set
     {
         if (EntityCtx.IsNotNull())
         {
             EntityProperty c = EntityCtx.Properties.FirstOrDefault(prop => prop.Name == property);
             if (c.IsNotNull() && c.Setter.IsNotNull())
             {
                 c.Setter(this, value);
             }
             else
             {
                 throw new ModelException("Type[" + GetType().Name + "] doesn't have column[" + property + "]");
             }
         }
     }
 }