public ValueTask <IQueryable> Visit(ExecuteGroupByStage executeGroupByStage) { Debug.Assert(queryable != null); var groupByExecutor = _groupByExecutorFactory.GetGroupByExecutor(executeGroupByStage); return(groupByExecutor.Execute(queryable, executeGroupByStage)); }
public IGroupByExecutor GetGroupByExecutor(ExecuteGroupByStage groupByStage) { var t = typeof(DefaultGroupByExecutor <,>).MakeGenericType(groupByStage.ValueType, groupByStage.KeyType); var executor = (IGroupByExecutor)Activator.CreateInstance(t); return(executor); }
protected Expression <Func <Entity, KeyType> > GetLambda(ExecuteGroupByStage groupByStage) { return(Expression.Lambda <Func <Entity, KeyType> >(groupByStage.Expression, groupByStage.ParameterExpression)); }
public abstract ValueTask <IQueryable <IGrouping <KeyType, Entity> > > ExecuteGroupBy(IQueryable <Entity> queryable, ExecuteGroupByStage groupByStage);
public async ValueTask <IQueryable> Execute(IQueryable queryable, ExecuteGroupByStage groupByStage) { return(await ExecuteGroupBy((IQueryable <Entity>) queryable, groupByStage)); }
public override ValueTask <IQueryable <IGrouping <KeyType, Entity> > > ExecuteGroupBy(IQueryable <Entity> queryable, ExecuteGroupByStage groupByStage) { return(new ValueTask <IQueryable <IGrouping <KeyType, Entity> > >(queryable.GroupBy(GetLambda(groupByStage)))); }