public ISelectExecutor GetSelectExecutor(ExecuteSelectStage selectStage)
        {
            var t        = typeof(DefaultSelectExecutor <,>).MakeGenericType(selectStage.InType, selectStage.OutType);
            var executor = (ISelectExecutor)Activator.CreateInstance(t);

            return(executor);
        }
Exemple #2
0
        public async ValueTask <IQueryable> Visit(ExecuteSelectStage executeSelectStage)
        {
            Debug.Assert(queryable != null);
            var selectExecutor = _selectExecutorFactory.GetSelectExecutor(executeSelectStage);

            var selectResult = await selectExecutor.Execute(queryable, executeSelectStage);

            columns = selectResult.Columns;

            return(selectResult.Queryable);
        }
Exemple #3
0
        protected Expression <Func <InType, OutType> > GetLambda(ExecuteSelectStage selectStage)
        {
            var lambda = Expression.Lambda <Func <InType, OutType> >(selectStage.Expression, selectStage.ParameterExpression);

            return(lambda);
        }
Exemple #4
0
 public abstract ValueTask <IQueryable <OutType> > ExecuteSelect(IQueryable <InType> queryable, ExecuteSelectStage selectStage);
Exemple #5
0
 public async ValueTask <SelectResult> Execute(IQueryable queryable, ExecuteSelectStage selectStage)
 {
     return(new SelectResult(await ExecuteSelect((IQueryable <InType>)queryable, selectStage), selectStage.Columns));
 }
 public override ValueTask <IQueryable <OutType> > ExecuteSelect(IQueryable <InType> queryable, ExecuteSelectStage selectStage)
 {
     return(new ValueTask <IQueryable <OutType> >(queryable.Select(GetLambda(selectStage))));
 }