public IEnumerable <object> SelectFields(IEnumerable <TSource> source, IEnumerable <string> fields) { var sourceType = typeof(TSource); var resultType = WithFieldsTypeBag.Get(sourceType, fields); var func = (Func <TSource, object>)MapperFuncBag.Get(sourceType, resultType); return(source.Select(func)); }
public IEnumerable <TResult> Select <TResult>(IEnumerable <object> source) { var func = MapperFuncBag.Get <TSource, TResult>(); return(((IEnumerable <TSource>)source).Select(func)); }