Base solution for your next web application
Open Closed

Getting error in every GetAll function after migrating to v8.0 #8016


User avatar
1
mujthabagroad created

Hi, After upgrading to newer version 8.0, getting an error in all menu which is generated with the RAD tool before.

ERROR 2019-11-14 15:04:01,086 [16   ] Mvc.ExceptionHandling.AbpExceptionFilter - The LINQ expression 'OrderBy<Currency, int>(     source: Where<Currency>(         source: Where<Currency>(             source: DbSet<Currency>,             predicate: (c) => !(((ISoftDelete)c).IsDeleted) || ((ISoftDelete)c).IsDeleted != (Unhandled parameter: __ef_filter__IsSoftDeleteFilterEnabled_0)),         predicate: (c) => (Nullable<int>)c.Id != (Unhandled parameter: __ou_CurrencyId_0)),     keySelector: (c) => (Unhandled parameter: __ObjectMapper_1).Map<CurrencyDto>(c).Id)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. System.InvalidOperationException: The LINQ expression 'OrderBy<Currency, int>(     source: Where<Currency>(         source: Where<Currency>(             source: DbSet<Currency>,             predicate: (c) => !(((ISoftDelete)c).IsDeleted) || ((ISoftDelete)c).IsDeleted != (Unhandled parameter: __ef_filter__IsSoftDeleteFilterEnabled_0)),         predicate: (c) => (Nullable<int>)c.Id != (Unhandled parameter: __ou_CurrencyId_0)),     keySelector: (c) => (Unhandled parameter: __ObjectMapper_1).Map<CurrencyDto>(c).Id)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.<VisitMethodCall>g__CheckTranslated|8_0(ShapedQueryExpression translated, <>c__DisplayClass8_0& )    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)    at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)    at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass12_01.<ExecuteAsync>b__0()    at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func1 compiler)    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)    at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)    at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.GetAsyncEnumerator(CancellationToken cancellationToken)    at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable1.GetAsyncEnumerator()    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken)    at ioNob.h2oERP.Base.CurrenciesAppService.GetAll(GetAllCurrenciesInput input) in D:\GitRepo\h2oERPZero\aspnet-core\src\ioNob.h2oERP.Application\Base\CurrenciesAppService.cs:line 82    at lambda_method(Closure , Object )    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Raising error from these sections in service.

var currencies = await query                 .OrderBy(input.Sorting ?? "currency.id asc")                 .PageBy(input)                 .ToListAsync(); Anythings needs to be changed?

Thanks.


No answer yet!