refactor: repUserId-Parameter zur ReadAllAsync-Methode in UserRepRepository hinzugefügt
This commit is contained in:
@@ -14,7 +14,7 @@ namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
|
||||
public async Task<IEnumerable<UserRep>> ReadAllAsync(
|
||||
bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false,
|
||||
int? userId = null, int? groupId = null, int? repGroupId = null, bool readOnly = true)
|
||||
int? userId = null, int? repUserId = null, int? groupId = null, int? repGroupId = null, bool readOnly = true)
|
||||
{
|
||||
var query = readOnly ? _dbSet.AsNoTracking() : _dbSet.AsQueryable();
|
||||
|
||||
@@ -30,9 +30,12 @@ namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
if (withRepUser)
|
||||
query = query.Include(ur => ur.RepUser);
|
||||
|
||||
if(userId is not null)
|
||||
if (userId is not null)
|
||||
query = query.Where(ur => ur.UserId == userId);
|
||||
|
||||
if (repUserId is not null)
|
||||
query = query.Where(ur => ur.RepUserId == repUserId);
|
||||
|
||||
if (groupId is not null)
|
||||
query = query.Where(ur => ur.GroupId == groupId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user