public override void Update(ProcessingLinqContext ctx) { var direction = ctx.CurrentMethod.Name.ComparedTo("OrderBy") ? OrderByDirection.Asc : OrderByDirection.Desc; var order = new OrderBy() { Direction = direction, Expression = ctx.CurrentMethod.Expression.Arguments[1] }; ctx.LinqQuery.AddOrderBy(order); }
public override void Update(ProcessingLinqContext ctx) { var args = ctx.CurrentMethod.Expression.Arguments; if (args.Count == 2) { ctx.LinqQuery.AddWhereClause(args[1]); } ctx.LinqQuery.PostProcess = ctx.CurrentMethod.Expression.Method.Name.Contains("Default") ? (IPostProcess) new FirstOrDefaultPostProcess() : new FirstPostProcess(); ctx.LinqQuery.Paging.Take = 1; }
public override void Update(ProcessingLinqContext ctx) { var args = ctx.CurrentMethod.Expression.Arguments; if (args.Count == 2) { ctx.LinqQuery.AddWhereClause(args[1]); } ctx.LinqQuery.PostProcess = ctx.CurrentMethod.Expression.Method.Name.Contains("Default") ? (IPostProcess) new SingleOrDefaultPostProcess() : new SinglePostProcess(); //note this take 2 is to ensure we have a SINGLE returned. ctx.LinqQuery.Paging.Take = 2; }
public override bool IndexQueryCompleted(ProcessingLinqContext ctx) { return(false); }
public override void Update(ProcessingLinqContext ctx) { ctx.LinqQuery.AddWhereClause(ctx.CurrentMethod.Expression.Arguments[1]); }
public abstract bool IndexQueryCompleted(ProcessingLinqContext ctx);
public abstract void Update(ProcessingLinqContext ctx);
public bool CanHandle(ProcessingLinqContext ctx) { return(Supported(ctx.CurrentMethod.Expression)); }
public override bool IndexQueryCompleted(ProcessingLinqContext ctx) { return(!AllowedNextStep.Any(x => x.ComparedTo(ctx.CurrentMethod.Name))); }
public override void Update(ProcessingLinqContext ctx) { var exp = (ConstantExpression)ctx.CurrentMethod.Expression.Arguments[1]; ctx.LinqQuery.Paging.Skip += Convert.ToInt64(exp.Value); }
public override bool IndexQueryCompleted(ProcessingLinqContext ctx) { return(!AllowedNextStep.Contains(ctx.CurrentMethod.Name.ToLower())); }
public override void Update(ProcessingLinqContext ctx) { throw new NotImplementedException(); }