public ISelectExecutor GetSelectExecutor(ExecuteSelectStage selectStage) { var t = typeof(DefaultSelectExecutor <,>).MakeGenericType(selectStage.InType, selectStage.OutType); var executor = (ISelectExecutor)Activator.CreateInstance(t); return(executor); }
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); }
protected Expression <Func <InType, OutType> > GetLambda(ExecuteSelectStage selectStage) { var lambda = Expression.Lambda <Func <InType, OutType> >(selectStage.Expression, selectStage.ParameterExpression); return(lambda); }
public abstract ValueTask <IQueryable <OutType> > ExecuteSelect(IQueryable <InType> queryable, ExecuteSelectStage selectStage);
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)))); }