internal QueryableActionResult(IQueryable <TElement> innerQueryable, QueryProjection projection, int?defaultPageSize) : base(innerQueryable) { Projection = projection; DefaultPageSize = defaultPageSize; }
private static IQueryableActionResult WrapActionResult <TElement, TResult>(IQueryable <TElement> source, QueryProjection projection, int?defaultPageSize) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new QueryableActionResult <TElement, TResult>(source, projection, defaultPageSize)); }
public static IQueryableActionResult <T> WrapActionResult <T>(this IQueryable <T> source, QueryProjection projection = null, int?defaultPageSize = null) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return((IQueryableActionResult <T>)WrapActionResult((IQueryable)source, projection, defaultPageSize)); }
public static object Execute(this IQueryable source, QueryProjection projection) { if (source == null) throw new ArgumentNullException(nameof(source)); if (projection == null) throw new ArgumentNullException(nameof(projection)); return projection.Execute(source); }
public static IQueryableActionResult WrapActionResult(this IQueryable source, QueryProjection projection = null, int?defaultPageSize = null) { if (source == null) { throw new ArgumentNullException(nameof(source)); } Type resultType; if (projection != null) { resultType = projection.GetResultType(source.ElementType); } else { projection = QueryProjection.AsEnumerable; resultType = source.ElementType; } return ((IQueryableActionResult)wrapActionResultGenericMethod.MakeGenericMethod(source.ElementType, resultType) .Invoke(null, new object[] { source, projection, defaultPageSize })); }
public virtual void AddSelector(QueryProjection <T, TResult> specification) { this.Selector = specification.ToSelectExpression(); }
public QueryWithProjectionBuilder <T, TResult> AddSelector(QueryProjection <T, TResult> specification) { this.query.AddSelector(specification); return(this); }
public QueryBuilderOptions(IReadOnlyList <IncludeExpression> includes = null, QueryProjection projection = QueryProjection.Default) { Includes = includes; Projection = projection; }