Ejemplo n.º 1
0
        internal IQueryable <TResult> To <TResult>(IObjectDictionary parameters, MemberPaths memberPathsToExpand)
        {
            var membersToExpand = memberPathsToExpand.SelectMany(m => m).Distinct().ToArray();

            var mapExpression = _builder.CreateMapExpression(_source.ElementType, typeof(TResult), parameters, membersToExpand);

            return(_source.Provider.CreateQuery <TResult>(
                       Expression.Call(
                           null,
                           QueryableSelectMethod.MakeGenericMethod(_source.ElementType, typeof(TResult)),
                           new[] { _source.Expression, Expression.Quote(mapExpression) }
                           )
                       ));
        }