- ABP Framework version: v8.0
- UI Type: Blazor Server
- Database System: EF Core
- Tiered (for MVC) or Auth Server Separated (for Angular): no
- Exception message and full stack trace:
- Steps to reproduce the issue:
I have added some property to User table, how can I query user (or Find user) base on that property. I try to find but there is not good answer
Thank you
6 Answer(s)
-
0
hi
https://support.abp.io/QA/Questions/6363/Object-Extension#answer-3a0f8e32-2ac0-ec3a-48f1-7a84e77294c4
https://learn.microsoft.com/en-us/ef/core/modeling/shadow-properties#accessing-shadow-properties
-
0
Can you give me example?
query.WhereIf(input.FullName.IsNotNullOrWhiteSpace(), e => EF.Property<string>(e, "FullName") == input.FullName); What is EF in this line?
-
0
hi
EF.Property
is a static method of EF Core.https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.ef.property?view=efcore-8.0 https://learn.microsoft.com/en-us/ef/core/modeling/shadow-properties#accessing-shadow-properties
-
0
But I want to call it in AppService, is it possible? With Tenant I can add my method by create interface public interface ICustomTenantRepository : IRepository<Tenant, Guid> { Task<Tenant> FindBySubscriptionIdAsync(string subscriptionId); } How can I do the same with IdentityUser?
-
0
hi
You shouldn't use EF Core in AppService layer.
You can add an interface in the domain and implement it in the EF Core layer. then use the interface in AppService layer.
-
0
Thank you I get it works