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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 4
0
 public override bool IndexQueryCompleted(ProcessingLinqContext ctx)
 {
     return(false);
 }
Ejemplo n.º 5
0
 public override void Update(ProcessingLinqContext ctx)
 {
     ctx.LinqQuery.AddWhereClause(ctx.CurrentMethod.Expression.Arguments[1]);
 }
Ejemplo n.º 6
0
 public abstract bool IndexQueryCompleted(ProcessingLinqContext ctx);
Ejemplo n.º 7
0
 public abstract void Update(ProcessingLinqContext ctx);
Ejemplo n.º 8
0
 public bool CanHandle(ProcessingLinqContext ctx)
 {
     return(Supported(ctx.CurrentMethod.Expression));
 }
Ejemplo n.º 9
0
 public override bool IndexQueryCompleted(ProcessingLinqContext ctx)
 {
     return(!AllowedNextStep.Any(x => x.ComparedTo(ctx.CurrentMethod.Name)));
 }
Ejemplo n.º 10
0
        public override void Update(ProcessingLinqContext ctx)
        {
            var exp = (ConstantExpression)ctx.CurrentMethod.Expression.Arguments[1];

            ctx.LinqQuery.Paging.Skip += Convert.ToInt64(exp.Value);
        }
Ejemplo n.º 11
0
 public override bool IndexQueryCompleted(ProcessingLinqContext ctx)
 {
     return(!AllowedNextStep.Contains(ctx.CurrentMethod.Name.ToLower()));
 }
Ejemplo n.º 12
0
 public override void Update(ProcessingLinqContext ctx)
 {
     throw new NotImplementedException();
 }