|
|
|
|
@ -140,6 +140,9 @@ namespace Volo.Abp.Identity.MongoDB
|
|
|
|
|
bool includeDetails = false,
|
|
|
|
|
Guid? roleId = null,
|
|
|
|
|
Guid? organizationUnitId = null,
|
|
|
|
|
string userName = null,
|
|
|
|
|
string phoneNumber = null,
|
|
|
|
|
string emailAddress = null,
|
|
|
|
|
CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
return await (await GetMongoQueryableAsync(cancellationToken))
|
|
|
|
|
@ -154,6 +157,9 @@ namespace Volo.Abp.Identity.MongoDB
|
|
|
|
|
)
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(roleId.HasValue, identityUser => identityUser.Roles.Any(x => x.RoleId == roleId.Value))
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(organizationUnitId.HasValue, identityUser => identityUser.OrganizationUnits.Any(x => x.OrganizationUnitId == organizationUnitId.Value))
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(userName), x => x.UserName == userName)
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(phoneNumber), x => x.PhoneNumber == phoneNumber)
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(emailAddress), x => x.Email == emailAddress)
|
|
|
|
|
.OrderBy(sorting.IsNullOrWhiteSpace() ? nameof(IdentityUser.UserName) : sorting)
|
|
|
|
|
.As<IMongoQueryable<IdentityUser>>()
|
|
|
|
|
.PageBy<IdentityUser, IMongoQueryable<IdentityUser>>(skipCount, maxResultCount)
|
|
|
|
|
@ -201,6 +207,9 @@ namespace Volo.Abp.Identity.MongoDB
|
|
|
|
|
string filter = null,
|
|
|
|
|
Guid? roleId = null,
|
|
|
|
|
Guid? organizationUnitId = null,
|
|
|
|
|
string userName = null,
|
|
|
|
|
string phoneNumber = null,
|
|
|
|
|
string emailAddress = null,
|
|
|
|
|
CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
return await (await GetMongoQueryableAsync(cancellationToken))
|
|
|
|
|
@ -215,6 +224,9 @@ namespace Volo.Abp.Identity.MongoDB
|
|
|
|
|
)
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(roleId.HasValue, identityUser => identityUser.Roles.Any(x => x.RoleId == roleId.Value))
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(organizationUnitId.HasValue, identityUser => identityUser.OrganizationUnits.Any(x => x.OrganizationUnitId == organizationUnitId.Value))
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(userName), x => x.UserName == userName)
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(phoneNumber), x => x.PhoneNumber == phoneNumber)
|
|
|
|
|
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(emailAddress), x => x.Email == emailAddress)
|
|
|
|
|
.LongCountAsync(GetCancellationToken(cancellationToken));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|