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); }
void readExpression(Expression <Func <TSource, object> > getterFunc) { SourceProperies = FetchPropertyFromExpression.Fetch(getterFunc); }