You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would appear that a query like this: $apply=groupby((disbursementYear),aggregate(disbursementAmount with sum as total)) which used to work under dotnet core 2.2, is not working when using dotnet core 3.1. I am getting IQueryable from the dbcontext and returning it via an Odata controller. I am not sure if this has to do with EF Core 3 not supporting client side processing or if I have missing something. I am guessing that if this was not an IQueryable it would work, but that would be a significant performance issue as some of our datasets are large. Any help would be.
Return a sql table from a dbcontext as IQueryable to the controller and return the IQueryable from the controller.
Expected result
The response would be the result of the aggregation based on the gouping specified in the request.
Actual result
Error: Stack trace bellow.
Additional detail
*An unhandled exception occurred while processing the request.
InvalidOperationException: Processing of the LINQ expression '(GroupByShaperExpression:
KeySelector: new GroupByWrapper{ GroupByContainer = new LastInChain{
Name = (N'disbursementYear'),
Value = (object)(g.DisbursementYear)
}
}
,
ElementSelector:new FlatteningWrapper{
Source = (EntityShaperExpression:
EntityType: VGrantAgreementDisbursement
ValueBufferExpression:
(ProjectionBindingExpression: Source)
IsNullable: False
),
GroupByContainer = new LastInChain{
Name = (ProjectionBindingExpression: GroupByContainer.Name),
Value = (ProjectionBindingExpression: GroupByContainer.Value)
}
}
)' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitExtension(Expression extensionExpression)
Thanks @hidegh. I know they are behind, just thought this should work as it did before. Guess I'll have to revêt back to 2.2 and keep my fingers crossed I don't need support from MS. Thanks again.
It would appear that a query like this: $apply=groupby((disbursementYear),aggregate(disbursementAmount with sum as total)) which used to work under dotnet core 2.2, is not working when using dotnet core 3.1. I am getting IQueryable from the dbcontext and returning it via an Odata controller. I am not sure if this has to do with EF Core 3 not supporting client side processing or if I have missing something. I am guessing that if this was not an IQueryable it would work, but that would be a significant performance issue as some of our datasets are large. Any help would be.
Assemblies affected
*Microsoft.AspNetCore.OData 7.3.0
*Microsoft.EntityFrameworkCore 3.1
*Microsoft.EntityFrameworkCore.SqlServer 3.1
Reproduce steps
Return a sql table from a dbcontext as IQueryable to the controller and return the IQueryable from the controller.
Expected result
The response would be the result of the aggregation based on the gouping specified in the request.
Actual result
Error: Stack trace bellow.
Additional detail
*An unhandled exception occurred while processing the request.
InvalidOperationException: Processing of the LINQ expression '(GroupByShaperExpression:
KeySelector: new GroupByWrapper{ GroupByContainer = new LastInChain{
Name = (N'disbursementYear'),
Value = (object)(g.DisbursementYear)
}
}
,
ElementSelector:new FlatteningWrapper{
Source = (EntityShaperExpression:
EntityType: VGrantAgreementDisbursement
ValueBufferExpression:
(ProjectionBindingExpression: Source)
IsNullable: False
),
GroupByContainer = new LastInChain{
Name = (ProjectionBindingExpression: GroupByContainer.Name),
Value = (ProjectionBindingExpression: GroupByContainer.Value)
}
}
)' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitExtension(Expression extensionExpression)
Stack Query Cookies Headers Routing
InvalidOperationException: Processing of the LINQ expression '(GroupByShaperExpression: KeySelector: new GroupByWrapper{ GroupByContainer = new LastInChain{ Name = (N'disbursementYear'), Value = (object)(g.DisbursementYear) } } , ElementSelector:new FlatteningWrapper{ Source = (EntityShaperExpression: EntityType: VGrantAgreementDisbursement ValueBufferExpression: (ProjectionBindingExpression: Source) IsNullable: False ), GroupByContainer = new LastInChain{ Name = (ProjectionBindingExpression: GroupByContainer.Name), Value = (ProjectionBindingExpression: GroupByContainer.Value) } } )' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitExtension(Expression extensionExpression)
System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Visit(Expression expression)
System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Visit(Expression expression)
System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor visitor, IArgumentProvider nodes)
System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node)
System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Visit(Expression expression)
System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Visit(Expression expression)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitMemberAssignment(MemberAssignment memberAssignment)
System.Linq.Expressions.ExpressionVisitor.VisitMemberBinding(MemberBinding node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitMemberInit(MemberInitExpression memberInitExpression)
System.Linq.Expressions.MemberInitExpression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Visit(Expression expression)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitMemberAssignment(MemberAssignment memberAssignment)
System.Linq.Expressions.ExpressionVisitor.VisitMemberBinding(MemberBinding node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitMemberInit(MemberInitExpression memberInitExpression)
System.Linq.Expressions.MemberInitExpression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Visit(Expression expression)
Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.Translate(SelectExpression selectExpression, Expression expression)
Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateSelect(ShapedQueryExpression source, LambdaExpression selector)
Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor(Expression query)
Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery(Expression query, bool async)
Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore(IDatabase database, Expression query, IModel model, bool async)
Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler+<>c__DisplayClass12_0.b__0()
Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore(object cacheKey, Func<Func<QueryContext, TFunc>> compiler)
Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery(object cacheKey, Func<Func<QueryContext, TResult>> compiler)
Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync(Expression query, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync(Expression expression, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable.GetAsyncEnumerator(CancellationToken cancellationToken)
Microsoft.AspNetCore.Mvc.Infrastructure.AsyncEnumerableReader.ReadInternal(IAsyncEnumerable value)
Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor.ExecuteAsyncEnumerable(ActionContext context, ObjectResult result, IAsyncEnumerable asyncEnumerable)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|21_0(ResourceInvoker invoker, IActionResult result)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNet.OData.Batch.ODataBatchMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Show raw exception details.*
The text was updated successfully, but these errors were encountered: