示例#1
0
        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);
        }
示例#3
0
 protected Expression <Func <Entity, KeyType> > GetLambda(ExecuteGroupByStage groupByStage)
 {
     return(Expression.Lambda <Func <Entity, KeyType> >(groupByStage.Expression, groupByStage.ParameterExpression));
 }
示例#4
0
 public abstract ValueTask <IQueryable <IGrouping <KeyType, Entity> > > ExecuteGroupBy(IQueryable <Entity> queryable, ExecuteGroupByStage groupByStage);
示例#5
0
 public async ValueTask <IQueryable> Execute(IQueryable queryable, ExecuteGroupByStage groupByStage)
 {
     return(await ExecuteGroupBy((IQueryable <Entity>) queryable, groupByStage));
 }
示例#6
0
 public override ValueTask <IQueryable <IGrouping <KeyType, Entity> > > ExecuteGroupBy(IQueryable <Entity> queryable, ExecuteGroupByStage groupByStage)
 {
     return(new ValueTask <IQueryable <IGrouping <KeyType, Entity> > >(queryable.GroupBy(GetLambda(groupByStage))));
 }