refactor(repository): ReadAsync-Methode aktualisieren, um readonly-Parameter zu unterstützen

This commit is contained in:
Developer 02 2024-10-23 13:36:50 +02:00
parent 31bf58919d
commit 859f0631f0
2 changed files with 6 additions and 6 deletions

View File

@ -5,8 +5,8 @@ namespace WorkFlow.Infrastructure.Contracts
{ {
public interface IProfileControlsTFRepository : ICRUDRepository<ProfileControlsTF, int> public interface IProfileControlsTFRepository : ICRUDRepository<ProfileControlsTF, int>
{ {
Task<IEnumerable<ProfileControlsTF>> ReadAsync(bool withProfile = true, bool withUser = false, int? profileId = null, int? objId = null, bool? profileActive = null); Task<IEnumerable<ProfileControlsTF>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, int? profileId = null, int? objId = null, bool? profileActive = null);
Task<ProfileControlsTF?> ReadAsync(bool withProfile = true, bool withUser = false, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null); Task<ProfileControlsTF?> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null);
} }
} }

View File

@ -38,11 +38,11 @@ namespace WorkFlow.Infrastructure.Repositories
return query; return query;
} }
public async Task<IEnumerable<ProfileControlsTF>> ReadAsync(bool withProfile = true, bool withUser = true, int? profileId = null, int? objId = null, bool? profileActive = null) public async Task<IEnumerable<ProfileControlsTF>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, int? profileId = null, int? objId = null, bool? profileActive = null)
=> await Read(withProfile: withProfile, withUser: withUser, profileId: profileId, objId: objId, profileActive: profileActive).ToListAsync(); => await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, profileId: profileId, objId: objId, profileActive: profileActive).ToListAsync();
public async Task<ProfileControlsTF?> ReadAsync(bool withProfile = true, bool withUser = false, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null) public async Task<ProfileControlsTF?> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null)
=> await Read(withProfile: withProfile, withUser: withUser, usrId: usrId, username: username, profileId: profileId, objId: objId, profileActive: profileActive) => await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, usrId: usrId, username: username, profileId: profileId, objId: objId, profileActive: profileActive)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
} }
} }