|
|
|
@ -15,13 +15,13 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
{ |
|
|
|
public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDbContext, IdentityUser, Guid>, IIdentityUserRepository |
|
|
|
{ |
|
|
|
public MongoIdentityUserRepository(IMongoDbContextProvider<IAbpIdentityMongoDbContext> dbContextProvider) |
|
|
|
public MongoIdentityUserRepository(IMongoDbContextProvider<IAbpIdentityMongoDbContext> dbContextProvider) |
|
|
|
: base(dbContextProvider) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<IdentityUser> FindByNormalizedUserNameAsync( |
|
|
|
string normalizedUserName, |
|
|
|
string normalizedUserName, |
|
|
|
bool includeDetails = true, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
@ -33,7 +33,7 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<List<string>> GetRoleNamesAsync( |
|
|
|
Guid id, |
|
|
|
Guid id, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
var user = await GetAsync(id, cancellationToken: GetCancellationToken(cancellationToken)); |
|
|
|
@ -42,8 +42,8 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<IdentityUser> FindByLoginAsync( |
|
|
|
string loginProvider, |
|
|
|
string providerKey, |
|
|
|
string loginProvider, |
|
|
|
string providerKey, |
|
|
|
bool includeDetails = true, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
@ -71,7 +71,7 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<List<IdentityUser>> GetListByNormalizedRoleNameAsync( |
|
|
|
string normalizedRoleName, |
|
|
|
string normalizedRoleName, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
@ -89,9 +89,9 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
|
|
|
|
public virtual async Task<List<IdentityUser>> GetListAsync( |
|
|
|
string sorting = null, |
|
|
|
int maxResultCount = int.MaxValue, |
|
|
|
int skipCount = 0, |
|
|
|
string filter = null, |
|
|
|
int maxResultCount = int.MaxValue, |
|
|
|
int skipCount = 0, |
|
|
|
string filter = null, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
@ -100,7 +100,8 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
|
u => |
|
|
|
u.UserName.Contains(filter) || |
|
|
|
u.Email.Contains(filter) |
|
|
|
u.Email.Contains(filter) || |
|
|
|
(u.PhoneNumber != null && u.PhoneNumber.Contains(filter)) |
|
|
|
) |
|
|
|
.OrderBy(sorting ?? nameof(IdentityUser.UserName)) |
|
|
|
.As<IMongoQueryable<IdentityUser>>() |
|
|
|
@ -132,4 +133,4 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
.LongCountAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|