Exemplo n.º 1
0
        public ValueTask <IQueryable> Visit(ExecuteWhereStage executeWhereStage)
        {
            Debug.Assert(queryable != null);
            var whereExecutor = _whereExecutorFactory.GetWhereExecutor(executeWhereStage);

            return(whereExecutor.Execute(queryable, executeWhereStage));
        }
Exemplo n.º 2
0
 public IWhereExecutor GetWhereExecutor(ExecuteWhereStage executeWhereStage)
 {
     if (!executors.TryGetValue(executeWhereStage.EntityType, out var executor))
     {
         var t = typeof(DefaultWhereExecutor <>).MakeGenericType(executeWhereStage.EntityType);
         executor = (IWhereExecutor)Activator.CreateInstance(t);
         executors.Add(executeWhereStage.EntityType, executor);
     }
     return(executor);
 }
Exemplo n.º 3
0
 protected Expression <Func <Entity, bool> > GetLambda(ExecuteWhereStage whereStage)
 {
     return(Expression.Lambda <Func <Entity, bool> >(whereStage.Expression, whereStage.ParameterExpression));
 }
Exemplo n.º 4
0
 public abstract ValueTask <IQueryable <Entity> > ExecuteWhere(IQueryable <Entity> queryable, ExecuteWhereStage whereStage);
Exemplo n.º 5
0
 public async ValueTask <IQueryable> Execute(IQueryable queryable, ExecuteWhereStage executeWhereStage)
 {
     return(await ExecuteWhere((IQueryable <Entity>) queryable, executeWhereStage));
 }
Exemplo n.º 6
0
 public override ValueTask <IQueryable <Entity> > ExecuteWhere(IQueryable <Entity> queryable, ExecuteWhereStage whereStage)
 {
     return(new ValueTask <IQueryable <Entity> >(queryable.Where(GetLambda(whereStage))));
 }