feat: readOnly-Parameter zur ReadAllAsync-Methode im UserRepRepository hinzufügen
This commit is contained in:
parent
622cb1f702
commit
9e11463ef2
@ -5,6 +5,6 @@ namespace DigitalData.UserManager.Infrastructure.Contracts
|
||||
{
|
||||
public interface IUserRepRepository : ICRUDRepository<UserRep, int>
|
||||
{
|
||||
Task<IEnumerable<UserRep>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null);
|
||||
Task<IEnumerable<UserRep>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null, bool readOnly = true);
|
||||
}
|
||||
}
|
||||
@ -12,9 +12,9 @@ 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)
|
||||
public async Task<IEnumerable<UserRep>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null, bool readOnly = true)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking();
|
||||
var query = readOnly ? _dbSet.AsNoTracking() : _dbSet.AsQueryable();
|
||||
|
||||
if (withUser)
|
||||
query = query.Include(ur => ur.User);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user