Browse Source

Added `includeDetails`

pull/14597/head
malik masis 4 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( Task<IdentityUser> FindByTenantIdAndUserNameAsync(
Guid tenantId, Guid tenantId,
[NotNull] string userName, [NotNull] string userName,
bool includeDetails = true,
CancellationToken cancellationToken = default 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(); 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()) return await(await GetDbSetAsync())
.IncludeDetails(includeDetails)
.FirstOrDefaultAsync( .FirstOrDefaultAsync(
u => u.TenantId == tenantId && u.UserName == userName, u => u.TenantId == tenantId && u.UserName == userName,
GetCancellationToken(cancellationToken) 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); .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)) return await (await GetMongoQueryableAsync(cancellationToken))
.FirstOrDefaultAsync( .FirstOrDefaultAsync(

Loading…
Cancel
Save