Open Closed

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


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&lt;Currency, int&gt;(     source: Where&lt;Currency&gt;(         source: Where&lt;Currency&gt;(             source: DbSet&lt;Currency&gt;,             predicate: (c) => !(((ISoftDelete)c).IsDeleted) || ((ISoftDelete)c).IsDeleted != (Unhandled parameter: __ef_filter__IsSoftDeleteFilterEnabled_0)),         predicate: (c) => (Nullable&lt;int&gt;)c.Id != (Unhandled parameter: __ou_CurrencyId_0)),     keySelector: (c) => (Unhandled parameter: __ObjectMapper_1).Map&lt;CurrencyDto&gt;(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&lt;Currency, int&gt;(     source: Where&lt;Currency&gt;(         source: Where&lt;Currency&gt;(             source: DbSet&lt;Currency&gt;,             predicate: (c) => !(((ISoftDelete)c).IsDeleted) || ((ISoftDelete)c).IsDeleted != (Unhandled parameter: __ef_filter__IsSoftDeleteFilterEnabled_0)),         predicate: (c) => (Nullable&lt;int&gt;)c.Id != (Unhandled parameter: __ou_CurrencyId_0)),     keySelector: (c) => (Unhandled parameter: __ObjectMapper_1).Map&lt;CurrencyDto&gt;(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.&lt;VisitMethodCall&gt;g__CheckTranslated|8_0(ShapedQueryExpression translated, &lt;&gt;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.&lt;&gt;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.&lt;InvokeNextActionFilterAsync&gt;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.&lt;InvokeInnerFilterAsync&gt;g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;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.


31 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @mujthabagroad

    • Does this happen for the newly generated pages ?
    • Could you share your entire query ?
  • 0
    mujthabagroad created

    Hello,

    <span class="colour" style="color: rgb(85, 85, 85);">Does this happen for the newly generated pages ?</span>
    

    Yes, tried with a newly generated view, but that view also has the same problem.

    public async Task<PagedResultDto<GetTestForViewDto>> GetAll(GetAllTestsInput input)
             {
    
    var filteredTests = _testRepository.GetAll()
    .Include( e => e.CostCenterFk)
    .WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false  || e.test1.Contains(input.Filter) || e.test2.Contains(input.Filter))
    .WhereIf(!string.IsNullOrWhiteSpace(input.test1Filter),  e => e.test1.ToLower() == input.test1Filter.ToLower().Trim())
    .WhereIf(!string.IsNullOrWhiteSpace(input.test2Filter),  e => e.test2.ToLower() == input.test2Filter.ToLower().Trim())
    .WhereIf(input.Mintest3Filter != null, e => e.test3 >= input.Mintest3Filter)
    .WhereIf(input.Maxtest3Filter != null, e => e.test3 <= input.Maxtest3Filter)
    .WhereIf(!string.IsNullOrWhiteSpace(input.CostCenterNameFilter), e => e.CostCenterFk != null && e.CostCenterFk.Name.ToLower() == input.CostCenterNameFilter.ToLower().Trim());
    
    var pagedAndFilteredTests = filteredTests
                    .OrderBy(input.Sorting ?? "id asc")
                    .PageBy(input);
    
    var tests = from o in pagedAndFilteredTests
                             join o1 in _lookup_costCenterRepository.GetAll() on o.CostCenterId equals o1.Id into j1
                             from s1 in j1.DefaultIfEmpty()
    
                             select new GetTestForViewDto() {
    Test = new TestDto
    {
                                    test1 = o.test1,
                                    test2 = o.test2,
                                    test3 = o.test3,
                                    Id = o.Id
    },
                             	CostCenterName = s1 == null ? "" : s1.Name.ToString()
    };
    
                var totalCount = await filteredTests.CountAsync();
    
                return new PagedResultDto<GetTestForViewDto>(
                    totalCount,
                    await tests.ToListAsync()
                );
             }
    

    Noticed that getting the error in the join section.

    join o1 in _lookup_costCenterRepository.GetAll() on o.CostCenterId equals o1.Id into j1
    

    Error details from error log:

    ERROR 2019-11-15 09:26:31,077 [56   ] Mvc.ExceptionHandling.AbpExceptionFilter - The LINQ expression 'Where<CostCenter>(
        source: DbSet<CostCenter>,
        predicate: (c) => Contains<long>(
            source: (Unhandled parameter: __ef_filter__AssociatedOuIds_2),
            value: ((IMustHaveOrganizationUnit)c).OrganizationUnitId) || (Nullable<long>)((IMustHaveOrganizationUnit)c).OrganizationUnitId == (Unhandled parameter: __ef_filter__CurrentOUId_3) == (Unhandled parameter: __ef_filter__IsOUFilterEnabled_4) && !(((ISoftDelete)c).IsDeleted) || ((ISoftDelete)c).IsDeleted != (Unhandled parameter: __ef_filter__IsSoftDeleteFilterEnabled_5) && ((IMayHaveTenant)c).TenantId == (Unhandled parameter: __ef_filter__CurrentTenantId_6) || ((IMustHaveTenant)c).TenantId == 0 == (Unhandled parameter: __ef_filter__IsMustHaveTenantFilterEnabled_7))' 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 'Where<CostCenter>(
        source: DbSet<CostCenter>,
        predicate: (c) => Contains<long>(
            source: (Unhandled parameter: __ef_filter__AssociatedOuIds_2),
            value: ((IMustHaveOrganizationUnit)c).OrganizationUnitId) || (Nullable<long>)((IMustHaveOrganizationUnit)c).OrganizationUnitId == (Unhandled parameter: __ef_filter__CurrentOUId_3) == (Unhandled parameter: __ef_filter__IsOUFilterEnabled_4) && !(((ISoftDelete)c).IsDeleted) || ((ISoftDelete)c).IsDeleted != (Unhandled parameter: __ef_filter__IsSoftDeleteFilterEnabled_5) && ((IMayHaveTenant)c).TenantId == (Unhandled parameter: __ef_filter__CurrentTenantId_6) || ((IMustHaveTenant)c).TenantId == 0 == (Unhandled parameter: __ef_filter__IsMustHaveTenantFilterEnabled_7))' 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.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
       at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
       at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
       at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
       at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.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_0`1.<ExecuteAsync>b__0()
       at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 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.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)
       at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()
       at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
       at ioNob.h2oERP.Tes.TestsAppService.GetAll(GetAllTestsInput input) in D:\GitRepo\h2oERPZero\aspnet-core\src\ioNob.h2oERP.Application\Tes\TestsAppService.cs:line 71
       at lambda_method(Closure , Object )
       at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
       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, ValueTask`1 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)
    

    One more thing I need to add that, we extended DbContext filter section for filtering OU and associated OU to filter data as the user should not see any data who don't have permission on particular OU, so data should be filtered based on listed OU Ids.

    protected override Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>()
            {
                var expression = base.CreateFilterExpression<TEntity>();
                expression = null;
                if (typeof(IMayHaveOrganizationUnit).IsAssignableFrom(typeof(TEntity)))
                {
                   Expression<Func<TEntity, bool>> mayHaveOUFilter = e =>
                   AssociatedOuIds.Contains((long)((IMayHaveOrganizationUnit)e).OrganizationUnitId) ||
                  (((IMayHaveOrganizationUnit)e).OrganizationUnitId == CurrentOUId) == IsOUFilterEnabled;
                    expression = expression == null ? mayHaveOUFilter : CombineExpressions(expression, mayHaveOUFilter);
                }
                if (typeof(IMustHaveOrganizationUnit).IsAssignableFrom(typeof(TEntity)))
                {
                    Expression<Func<TEntity, bool>> mayHaveOUFilter = e =>
                    AssociatedOuIds.Contains(((IMustHaveOrganizationUnit)e).OrganizationUnitId) ||
                 (((IMustHaveOrganizationUnit)e).OrganizationUnitId == CurrentOUId) == IsOUFilterEnabled;
                 expression = expression == null ? mayHaveOUFilter : CombineExpressions(expression, mayHaveOUFilter);
                }
    

    We are stuck here and quick support will be helpful to move with.

    Thank You.

  • 0
    mujthabagroad created

    Hello,

    Waiting for the support as we coultdn't resolve it.

    Thanks.

  • 0
    mujthabagroad created

    Hi,

    I generated a new view with RAD Tool to check the issue as instructed. but raising the same error in GetAll function. Getting this error while loading all CRUD views.

    Thanks.

  • 0
    maliming created
    Support Team

    hi @mujthabagroad Can you reproduce this problem using the Zero demo project?

    If you can, please share the code, I will download and check it out as quickly as possible. liming.ma@volosoft.com

  • 0
    mujthabagroad created

    Hi @maliming Can you take remote access and check, i sent access details to your email.

    Thanks.

  • 0
    maliming created
    Support Team

    The network status is not good, Can you reproduce this problem using the Zero demo project?

  • 0
    mujthabagroad created

    Yes, the issue is there on newly downloaded app package. Steps to reproduce:

    1. Create View with RAD Tool with reference to any other table 
    2. Goto menu and try to load CRUD view or Lookup in add new.

    I will share this test solution via mail as well.

  • 0
    mujthabagroad created

    Hi @maliming

    I shared the code, kindly check and assist us. also, I can see some DEBUG lines in thelog file which is accumulating.

    DEBUG 2019-11-19 11:55:11,425 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:16,435 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:21,453 [12   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:26,465 [22   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:31,468 [13   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:36,480 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:41,483 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:46,500 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:51,519 [12   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:55:56,533 [13   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:01,536 [14   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:06,553 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:11,583 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:16,583 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:21,600 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:26,604 [13   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:31,606 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:36,609 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:41,620 [13   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:46,624 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:51,638 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:56:56,645 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:01,658 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:06,673 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:11,681 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:16,685 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:21,690 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:26,698 [13   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:31,700 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:36,713 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:41,716 [24   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:46,719 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:51,723 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:57:56,731 [12   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:01,738 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:06,745 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:11,749 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:16,751 [13   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:21,765 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:26,777 [12   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:31,793 [42   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:36,798 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:41,802 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:46,803 [42   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:51,806 [42   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:58:56,810 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:59:01,815 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:59:06,825 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:59:11,829 [40   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:59:16,834 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:59:21,840 [35   ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    DEBUG 2019-11-19 11:59:26,845 [4    ] HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null
    
  • 0
    maliming created
    Support Team

    Unable to get URL from HttpRequest, fallback to null

    see https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4956

  • 0
    maliming created
    Support Team

    @mujthabagroad

    I can't reproduce the problem. Am I missing any steps?

  • 0
    mujthabagroad created

    Working fine in host login.

    Sign in to the Default tenant and check.

  • 0
    maliming created
    Support Team

  • 0
    mujthabagroad created

    Just try to add one row. displaying language data in lookup modal?. or can you take access to my PC again?. so that I can show you.

  • 0
    maliming created
    Support Team

    You can see the chrome Network panel in my screenshot. All requests are successful (http status code 200), There are no errors in the log.

  • 0
    mujthabagroad created

    My chrome raises the issue with the status of 500. did u try to search on lookup modal search bar?. Is there any libraries that need to be upgraded on my system?

  • 0
    maliming created
    Support Team

    hi @mujthabagroad I have successfully reproduced your problem, I will check it.

  • 0
    maliming created
    Support Team

    Please remove methods like ToString() and ToLower() in the entity expression.

    We will update the RAD Tool template.

  • 0
    mujthabagroad created

    Hi @maliming This error is not related to that I guess, error log also shows that related to client evaluation, I removed all as you instructed and tried, still have the same issue.  This is the error log.

    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)),
    

    Can go through this issue, seems similar to me. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4946

    Thanks.

  • 0
    maliming created
    Support Team

    hi @mujthabagroad

    How to reproduce the above mentioned problems?

    The LINQ expression 'OrderBy<Currency, int>(...
    
  • 0
    mujthabagroad created

    The same steps I mentioned above. Getting this error while executing the expression. am getting this on every menu in a tenant login.

  • 0
    maliming created
    Support Team

    This issue is resolved remotely.

    @yunus emre kalkan Will check and update the Rad tools template.

  • 0
    mujthabagroad created

    Just describe what was the case, so that will be useful for others

  • 0
    maliming created
    Support Team

    The first is that there is a problem with the RAD Tool's template code. As I mentioned above.

    Then there is a problem with your query code. If you like, you can share some of your code.

  • 0
    mujthabagroad created

    Hi maliming,

    The issue still there, we checked the view which doesn't have Tenant filter and IsDeleted filter. can you check it again?. We extended dbcontext for filters and raising an error on that. it is working fine when we comment that expressions. I posted the expressions above. we had done these changes based on documentation https://aspnetboilerplate.com/Pages/Documents/Articles\How-To\add-custom-data-filter-ef-core?searchKey=custom%20filters

    Thanks.

  • 0
    joe704la created

    I am having very similar issues on all my custom services after the upgrade to 8.0.0 and haven't figured out what the true issue is. @mujthabagroad I am not following how you fixed it. Can you give me any advice?

    I have having issues in almost every service. But I can give an example below of one query that is causing an issue that didn't before the .NET Core 3 update. If I remove the "&& DateTime.Compare(Clock.Now, a.StartDateTime) > 0" it then seems to work. SO it seems like a simular issue to https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5026#issuecomment-554157095 talking about here.

    var numberOfAppointments = await _appointmentRepository.GetAll() .Where(a => a.UserId == user.Id && DateTime.Compare(Clock.Now, a.StartDateTime) > 0).CountAsync();

  • 0
    mujthabagroad created

    Hi @joe704l,

    But we are facing different issue than yours. We added override method in dbcontext for custom filters. Facing issues there. If we commet those, will work all perfectly. @maliming can u look into it again as our license is going to be expired by tomorrow.

    Thanks.

  • 0
    maliming created
    Support Team

    hi @mujthabagroad Can you reproduce this problem using the Zero demo project? It’s too slow to solve the problem remotely.

  • 0
    dmerf created

    Has this problem been solved? We are about to proceed with full-scale development of our new ASP.NET Zero project. The split .NET Core 3.0 Host/Angular 8 solution which I downloaded about two weeks ago, verified and uploaded to our repo has started throwing this same error message "HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null". This happens when I code gen an entity from the database into the solution and try to navigate to the entity's index view while running. We also tested this on another developer machine which also was working before and also with a freshly download solution from ASP.NET Zero. We are completely blocked from starting development. We have two days left in our 30 day money-back guarantee period and we are contemplating our options moving forward given this showstopper issue along with all the other bugs, flaws and difficulties we have previously reported.

  • 0
    maliming created
    Support Team

    verified and uploaded to our repo has started throwing this same error message "HttpRequestEntityChangeSetReasonProvider - Unable to get URL from HttpRequest, fallback to null".

    This is just a DEBUG log for information purposes. This log will be removed with the next version.

  • 0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.