feat: Überladungen der Read-Methode für ProfileObjStateRepository hinzufügen

- Überladene ReadAsync-Methoden in ProfileObjStateRepository implementiert, um Filterung nach Benutzer und Status zu ermöglichen.
- Die Abfrageeffizienz durch Einbeziehung verwandter Entitäten und Anwendung bedingter Filter verbessert.
This commit is contained in:
Developer 02 2024-10-23 14:12:04 +02:00
parent e1f0d611e5
commit b0896c214f
2 changed files with 10 additions and 0 deletions

View File

@ -5,5 +5,8 @@ namespace WorkFlow.Infrastructure.Contracts
{
public interface IProfileObjStateRepository : ICRUDRepository<ProfileObjState, int>
{
Task<IEnumerable<ProfileObjState>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, bool withState = true, int? profileId = null, int? objId = null, bool? profileActive = null);
Task<ProfileObjState?> 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);
}
}

View File

@ -43,5 +43,12 @@ namespace WorkFlow.Infrastructure.Repositories
return query;
}
public async Task<IEnumerable<ProfileObjState>> 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<ProfileObjState?> 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();
}
}