Check the docs before asking a question: https://docs.abp.io/en/abp/4.2/Entity-Framework-Core#repository-get-find-methods
- ABP Framework version: v4.2.2
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
IBasicRepository **Get ** and Find doesn't load related entities when even we set include details to the true
7 Answer(s)
-
0
hi
Did you override the
WithDetailsAsync
andWithDetails
methods?https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs#L86
https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityEfCoreQueryableExtensions.cs#L8
https://docs.abp.io/en/abp/latest/Best-Practices/Entity-Framework-Core-Integration#repository-implementation https://docs.abp.io/en/abp/4.2/Entity-Framework-Core#loading-related-entities
-
0
Hello, Thx for the reply. I'm sorry i didn't get it https://docs.abp.io/en/abp/4.2/Entity-Framework-Core#loading-related-entities
Why should i override WithDetailsAsync and WithDetails methods ?
I have problem with Find and Get Method not with WithDetailsAsync and
Wasn't your answer already implemented on base EfCoreRepository class? But somehow i need to pass relation info
-
0
Doh do i need to set this to able use Find and Get method ?
"If you don't pass any expression to the WithDetailsAsync method, then it includes all the details using the DefaultWithDetailsFunc option you provide."
https://docs.abp.io/en/abp/4.2/Entity-Framework-Core#defaultwithdetailsfunc
-
0
hi raif
EfCoreRepository does not know the include() info by default.
You need to specify it manually.
Please refer to the implementation of the Identity module: https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs#L86 https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityEfCoreQueryableExtensions.cs#L8
-
0
Hi @raif, can you solved this problem ? i have a problem like this.
-
0
Hi @raif, can you solved this problem ? i have a problem like this.
Yes, with help of best practice documentation i'm fine. See : https://docs.abp.io/en/abp/latest/Best-Practices/Entity-Framework-Core-Integration#repository-implementation
-
0
Hi @raif, can you solved this problem ? i have a problem like this.
Yes, with help of best practice documentation i'm fine. See : https://docs.abp.io/en/abp/latest/Best-Practices/Entity-Framework-Core-Integration#repository-implementation
thank you so much. i will try.