From ca94368d0b5d78b6641315de026420a607058a65 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 24 Oct 2024 15:15:41 +0200 Subject: [PATCH] =?UTF-8?q?feat(ProfileObjStateRepository):=20Zwei=20async?= =?UTF-8?q?hrone=20Lesemethoden=20wurden=20zusammengef=C3=BChrt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contracts/IProfileObjStateRepository.cs | 8 +++++--- .../Repositories/ProfileObjStateRepository.cs | 17 +++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs b/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs index 95afaa1..83a6600 100644 --- a/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs +++ b/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs @@ -5,8 +5,10 @@ namespace WorkFlow.Infrastructure.Contracts { public interface IProfileObjStateRepository : ICRUDRepository { - Task> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, bool withState = true, int? profileId = null, int? objId = null, bool? profileActive = null); - - Task ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, bool withState = true, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null); + Task> ReadAsync( + bool isReadonly = true, + bool withProfile = true, bool withUser = true, bool withState = true, + int? usrId = null, string? username = null, + int? profileId = null, int? objId = null, bool? profileActive = null); } } \ No newline at end of file diff --git a/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs b/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs index 6039dd6..e25fad6 100644 --- a/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs +++ b/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs @@ -44,11 +44,16 @@ namespace WorkFlow.Infrastructure.Repositories return query; } - public async Task> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, bool withState = true, int? profileId = null, int? objId = null, bool? profileActive = null) - => await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, withState: withState, profileId: profileId, objId: objId, profileActive: profileActive).ToListAsync(); - - public async Task ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, bool withState = true, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null) - => await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, withState: withState, usrId: usrId, username: username, profileId: profileId, objId: objId, profileActive: profileActive) - .FirstOrDefaultAsync(); + public async Task> ReadAsync( + bool isReadonly = true, + bool withProfile = true, bool withUser = true, bool withState = true, + int? usrId = null, string? username = null, + int? profileId = null, int? objId = null, bool? profileActive = null) + => await Read( + isReadonly: isReadonly, + withProfile: withProfile, withUser: withUser, withState: withState, + usrId: usrId, username: username, + profileId: profileId, objId: objId, profileActive: profileActive) + .ToListAsync(); } } \ No newline at end of file