public QueryMany(Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : base(QueryOperation.Many) { this.Where = where; this.Order = order; this.Skip = skip; this.Take = take; this.Graph = graph; }
public QueryFirst(Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, Graph <TModel> graph) : base(QueryOperation.First) { this.Where = where; this.Order = order; this.Skip = null; this.Take = null; this.Graph = graph; }
public string ConvertInternal(QueryOperation select, Expression where, QueryOrder order, int?skip, int?take, Graph graph, ModelDetail modelDetail) { var operationContext = new MemberContext(); var sb = new CharWriteBuffer(); try { Convert(ref sb, select, where, order, skip, take, graph, modelDetail, operationContext); return(sb.ToString()); } finally { sb.Dispose(); } }
public EventQueryMany(DateTime?temporalDateFrom, DateTime?temporalDateTo, int?temporalSkip, int?temporalTake, QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : this(null, temporalDateFrom, temporalDateTo, null, null, temporalSkip, temporalTake, null, order, skip, take, graph) { }
public EventQueryMany(TemporalOrder temporalOrder, DateTime?temporalDateFrom, DateTime?temporalDateTo, QueryOrder <TModel> order) : this(temporalOrder, temporalDateFrom, temporalDateTo, null, null, null, null, null, order, null, null, null) { }
public QueryMany(Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, Graph <TModel> graph) : this(where, order, null, null, graph) { }
public QueryMany(QueryOrder <TModel> order, Graph <TModel> graph) : this(null, order, null, null, graph) { }
public QueryMany(QueryOrder <TModel> order, int?skip, int?take) : this(null, order, skip, take, null) { }
//public static IOrderedQueryable<TSource> OrderBy<TSource, TModel>(this IQueryable<TSource> source, QueryOrder<TModel> linqOrder) // where TModel : class, new() //{ // IQueryable<TSource> result = source; // foreach (var order in linqOrder.OrderExpressions.Reverse()) // { // var sourceOrder = LinqRebinder.RebindType(order.Expression, typeof(TModel), typeof(TSource)); // var propertyType = ((LambdaExpression)sourceOrder).ReturnType; // if (order.Descending) // { // var method = TypeAnalyzer.GetGenericMethod(queryableOrderByDescending, typeof(TSource), propertyType); // result = (IOrderedQueryable<TSource>)method.Caller(null, new object[] { result, sourceOrder }); // } // else // { // var method = TypeAnalyzer.GetGenericMethod(queryableOrderBy, typeof(TSource), propertyType); // result = (IOrderedQueryable<TSource>)method.Caller(null, new object[] { result, sourceOrder }); // } // } // return (IOrderedQueryable<TSource>)result; //} public static IOrderedQueryable <TModel> OrderBy <TModel>(this IQueryable <TModel> source, QueryOrder <TModel> linqOrder) where TModel : class, new() { IQueryable <TModel> result = source; foreach (var order in linqOrder.OrderExpressions.Reverse()) { var propertyType = ((LambdaExpression)order.Expression).ReturnType; if (order.Descending) { var method = TypeAnalyzer.GetGenericMethodDetail(queryableOrderByDescending, typeof(TModel), propertyType); result = (IOrderedQueryable <TModel>)method.Caller(null, new object[] { result, order.Expression }); } else { var method = TypeAnalyzer.GetGenericMethodDetail(queryableOrderBy, typeof(TModel), propertyType); result = (IOrderedQueryable <TModel>)method.Caller(null, new object[] { result, order.Expression }); } } return((IOrderedQueryable <TModel>)result); }
protected void Convert(ref CharWriteBuffer sb, QueryOperation select, Expression where, QueryOrder order, int?skip, int?take, Graph graph, ModelDetail modelDetail, MemberContext operationContext) { var hasWhere = where != null; var hasOrderSkipTake = (select == QueryOperation.Many || select == QueryOperation.First) && (order?.OrderExpressions.Length > 0 || skip > 0 || take > 0); GenerateSelect(select, graph, modelDetail, ref sb); GenerateFrom(modelDetail, ref sb); if (hasWhere || hasOrderSkipTake) { var rootDependant = new ParameterDependant(modelDetail, null); var sbWhereOrder = new CharWriteBuffer(); try { if (hasWhere) { GenerateWhere(where, ref sbWhereOrder, rootDependant, operationContext); } if (hasOrderSkipTake) { GenerateOrderSkipTake(order, skip, take, ref sbWhereOrder, rootDependant, operationContext); } GenerateJoin(rootDependant, ref sb); sb.Write(sbWhereOrder); } finally { sbWhereOrder.Dispose(); } } GenerateEnding(select, graph, modelDetail, ref sb); }
public EventQueryMany(TemporalOrder temporalOrder, ulong?temporalNumberFrom, ulong?temporalNumberTo, QueryOrder <TModel> order, Graph <TModel> graph) : this(temporalOrder, null, null, temporalNumberFrom, temporalNumberTo, null, null, null, order, null, null, graph) { }
public EventQueryMany(DateTime?temporalDateFrom, DateTime?temporalDateTo, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, int?skip, int?take) : this(null, temporalDateFrom, temporalDateTo, null, null, null, null, where, order, skip, take, null) { }
public EventQueryMany(TemporalOrder temporalOrder, ulong?temporalNumberFrom, ulong?temporalNumberTo, QueryOrder <TModel> order, int?skip, int?take) : this(temporalOrder, null, null, temporalNumberFrom, temporalNumberTo, null, null, null, order, skip, take, null) { }
public EventQueryMany(TemporalOrder temporalOrder, DateTime?temporalDateFrom, DateTime?temporalDateTo, int?temporalSkip, int?temporalTake, QueryOrder <TModel> order, Graph <TModel> graph) : this(temporalOrder, temporalDateFrom, temporalDateTo, null, null, temporalSkip, temporalTake, null, order, null, null, graph) { }
public EventQueryMany(TemporalOrder temporalOrder, DateTime?temporalDateFrom, DateTime?temporalDateTo, int?temporalSkip, int?temporalTake, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order) : this(temporalOrder, temporalDateFrom, temporalDateTo, null, null, temporalSkip, temporalTake, where, order, null, null, null) { }
public EventQueryMany(TemporalOrder temporalOrder, DateTime?temporalDateFrom, DateTime?temporalDateTo, int?temporalSkip, int?temporalTake, QueryOrder <TModel> order, int?skip, int?take) : this(temporalOrder, temporalDateFrom, temporalDateTo, null, null, temporalSkip, temporalTake, null, order, skip, take, null) { }
public EventQueryMany(TemporalOrder temporalOrder, DateTime?temporalDateFrom, DateTime?temporalDateTo, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : this(temporalOrder, temporalDateFrom, temporalDateTo, null, null, null, null, where, order, skip, take, graph) { }
public EventQueryMany(DateTime?temporalDateFrom, DateTime?temporalDateTo, int?temporalSkip, int?temporalTake, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, Graph <TModel> graph) : this(null, temporalDateFrom, temporalDateTo, null, null, temporalSkip, temporalTake, where, order, null, null, graph) { }
public EventQueryMany(TemporalOrder temporalOrder, ulong?temporalNumberFrom, ulong?temporalNumberTo, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, Graph <TModel> graph) : this(temporalOrder, null, null, temporalNumberFrom, temporalNumberTo, null, null, where, order, null, null, graph) { }
public EventQueryMany(TemporalOrder temporalOrder, ulong?temporalNumberFrom, ulong?temporalNumberTo, int?temporalSkip, int?temporalTake, QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : this(temporalOrder, null, null, temporalNumberFrom, temporalNumberTo, temporalSkip, temporalTake, null, order, skip, take, graph) { }
private static QueryOrder <TModel> CompressOrder(QueryOrder <TModel> order) { return(order); }
public EventQueryMany(DateTime?temporalDateFrom, DateTime?temporalDateTo, QueryOrder <TModel> order, Graph <TModel> graph) : this(null, temporalDateFrom, temporalDateTo, null, null, null, null, null, order, null, null, graph) { }
public QueryMany(QueryOrder <TModel> order) : this(null, order, null, null, null) { }
public EventQueryMany(TemporalOrder temporalOrder, ulong?temporalNumberFrom, ulong?temporalNumberTo, int?temporalSkip, int?temporalTake, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : this(temporalOrder, null, null, temporalNumberFrom, temporalNumberTo, temporalSkip, temporalTake, where, order, skip, take, graph) { }
public QueryMany(Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, int?skip, int?take) : this(where, order, skip, take, null) { }
public EventQueryMany(ulong?temporalNumberFrom, ulong?temporalNumberTo, int?temporalSkip, int?temporalTake, QueryOrder <TModel> order) : this(null, null, null, temporalNumberFrom, temporalNumberTo, temporalSkip, temporalTake, null, order, null, null, null) { }
public QueryMany(QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : this(null, order, skip, take, graph) { }
public EventQueryMany(DateTime?temporalDateFrom, DateTime?temporalDateTo, int?temporalSkip, int?temporalTake, QueryOrder <TModel> order) : this(null, temporalDateFrom, temporalDateTo, null, null, temporalSkip, temporalTake, null, order, null, null, null) { }
public EventQueryMany(TemporalOrder?temporalOrder, DateTime?temporalDateFrom, DateTime?temporalDateTo, ulong?temporalNumberFrom, ulong?temporalNumberTo, int?temporalSkip, int?temporalTake, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order, int?skip, int?take, Graph <TModel> graph) : base(QueryOperation.EventMany) { this.TemporalOrder = temporalOrder ?? Repository.TemporalOrder.Newest; this.TemporalDateFrom = temporalDateFrom; this.TemporalDateTo = temporalDateTo; this.TemporalNumberFrom = temporalNumberFrom; this.TemporalNumberTo = temporalNumberTo; this.TemporalSkip = temporalSkip; this.TemporalTake = temporalTake; this.Where = where; this.Order = order; this.Skip = skip; this.Take = take; this.Graph = graph; }
public EventQueryMany(ulong?temporalNumberFrom, ulong?temporalNumberTo, int?temporalSkip, int?temporalTake, Expression <Func <TModel, bool> > where, QueryOrder <TModel> order) : this(null, null, null, temporalNumberFrom, temporalNumberTo, temporalSkip, temporalTake, where, order, null, null, null) { }