Browse Source

Added `includeDetails`

pull/14597/head
malik masis 3 years ago
parent
commit
6ae2fcc2e6
  1. 1
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs
  2. 7
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs
  3. 6
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs

1
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs

@ -106,6 +106,7 @@ public interface IIdentityUserRepository : IBasicRepository<IdentityUser, Guid>
Task<IdentityUser> FindByTenantIdAndUserNameAsync(
Guid tenantId,
[NotNull] string userName,
bool includeDetails = true,
CancellationToken cancellationToken = default
);
}

7
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs

@ -303,9 +303,14 @@ public class EfCoreIdentityUserRepository : EfCoreRepository<IIdentityDbContext,
return (await GetQueryableAsync()).IncludeDetails();
}
public virtual async Task<IdentityUser> FindByTenantIdAndUserNameAsync(Guid tenantId, [NotNull] string userName, CancellationToken cancellationToken = default)
public virtual async Task<IdentityUser> FindByTenantIdAndUserNameAsync(
Guid tenantId,
[NotNull] string userName,
bool includeDetails = true,
CancellationToken cancellationToken = default)
{
return await(await GetDbSetAsync())
.IncludeDetails(includeDetails)
.FirstOrDefaultAsync(
u => u.TenantId == tenantId && u.UserName == userName,
GetCancellationToken(cancellationToken)

6
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs

@ -271,7 +271,11 @@ public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDb
.ToListAsync(cancellationToken);
}
public virtual async Task<IdentityUser> FindByTenantIdAndUserNameAsync(Guid tenantId, [NotNull] string userName, CancellationToken cancellationToken = default)
public virtual async Task<IdentityUser> FindByTenantIdAndUserNameAsync(
Guid tenantId,
[NotNull] string userName,
bool includeDetails = true,
CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
.FirstOrDefaultAsync(

Loading…
Cancel
Save