diff --git a/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs b/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs index 5cdaa38..95afaa1 100644 --- a/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs +++ b/WorkFlow.Infrastructure/Contracts/IProfileObjStateRepository.cs @@ -5,5 +5,8 @@ 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); } } \ No newline at end of file diff --git a/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs b/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs index 5d88fe0..6039dd6 100644 --- a/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs +++ b/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs @@ -43,5 +43,12 @@ 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(); } } \ No newline at end of file