示例#1
0
        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));
        }
示例#2
0
        public IEnumerable <TResult> Select <TResult>(IEnumerable <object> source)
        {
            var func = MapperFuncBag.Get <TSource, TResult>();

            return(((IEnumerable <TSource>)source).Select(func));
        }