Exemplo n.º 1
0
 public void SetObjectDisplayFunc <TObject> (Expression <Func <TObject, string> > expDisplayFunc) where TObject : class
 {
     if (typeof(TObject) != SubjectType)
     {
         throw new InvalidCastException(String.Format("SubjectType = {0}, а DisplayFunc задается для {1}", SubjectType, typeof(TObject)));
     }
     displayFields     = FetchPropertyFromExpression.Fetch(expDisplayFunc);
     ObjectDisplayFunc = o => expDisplayFunc.Compile() (o as TObject);
 }
Exemplo n.º 2
0
 void readExpression(Expression <Func <TSource, object> > getterFunc)
 {
     SourceProperies = FetchPropertyFromExpression.Fetch(getterFunc);
 }