abp icon indicating copy to clipboard operation
abp copied to clipboard

Lazy-loading abp suite

Open Wiblox opened this issue 4 years ago • 2 comments

Documentation

Please check the official documentation before asking questions: https://docs.abp.io

GitHub Issues

GitHub issues are for bug reports, feature requests and other discussions about the framework.

If you're creating a bug/problem report, please include followings:

ABP 5.1.2 Blazor EF Core

"No backing field was found for property 'Plan.GatewayPlans'. Lazy-loaded navigations must have backing fields. Either name the backing field so that it is discovered by convention or configure the backing field to use."

Create a blank project with abp suite, set it to use lazy-loading in entityframeworkcore.

    Configure<AbpDbContextOptions>(options =>
    {
        options.PreConfigure<ManulocDbContext>(opts =>
        {
            opts.DbContextOptions.UseLazyLoadingProxies(); //Enable lazy loading
        });

        options.UseSqlServer();
    });
    
    And after another migration we get the above error.
    
    Yet no problem with non-commercial abp

Wiblox avatar Jan 25 '22 21:01 Wiblox

Hi,

We don't recommend you use lazy loading: https://docs.microsoft.com/en-us/ef/core/performance/efficient-querying#beware-of-lazy-loading

See: https://github.com/abpframework/abp/issues/2935

realLiangshiwei avatar Jan 26 '22 01:01 realLiangshiwei

Thanks.

Wiblox avatar Jan 26 '22 09:01 Wiblox