From 2c66112d4d1d303d67a097c2605978f37a0cc4b1 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 24 Oct 2024 18:57:39 +0200 Subject: [PATCH] feat(ProfileObjStateService): ReadAsync-Methode als Schnittstellenimplementierung erstellt. --- .../Contracts/IProfileObjStateService.cs | 5 +++++ .../Services/ProfileObjStateService.cs | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/WorkFlow.Application/Contracts/IProfileObjStateService.cs b/WorkFlow.Application/Contracts/IProfileObjStateService.cs index 5393b6b..ed5586a 100644 --- a/WorkFlow.Application/Contracts/IProfileObjStateService.cs +++ b/WorkFlow.Application/Contracts/IProfileObjStateService.cs @@ -1,4 +1,5 @@ using DigitalData.Core.Abstractions.Application; +using DigitalData.Core.DTO; using WorkFlow.Application.DTO.ProfileObjState; using WorkFlow.Domain.Entities; @@ -6,5 +7,9 @@ namespace WorkFlow.Application.Contracts { public interface IProfileObjStateService : ICRUDService { + Task>> ReadAsync( + bool withProfile = true, bool withUser = true, bool withState = true, + int? userId = null, string? username = null, + int? profileId = null, int? objId = null, bool? profileActive = null); } } \ No newline at end of file diff --git a/WorkFlow.Application/Services/ProfileObjStateService.cs b/WorkFlow.Application/Services/ProfileObjStateService.cs index e8a9ccb..b14a173 100644 --- a/WorkFlow.Application/Services/ProfileObjStateService.cs +++ b/WorkFlow.Application/Services/ProfileObjStateService.cs @@ -1,6 +1,7 @@ using AutoMapper; using DigitalData.Core.Abstractions.Application; using DigitalData.Core.Application; +using DigitalData.Core.DTO; using WorkFlow.Application.Contracts; using WorkFlow.Application.DTO.ProfileObjState; using WorkFlow.Domain.Entities; @@ -12,5 +13,20 @@ namespace WorkFlow.Application.Services : CRUDService(repository, mapper), IProfileObjStateService, ICRUDService { + public async Task>> ReadAsync( + bool withProfile = true, bool withUser = true, bool withState = true, + int? userId = null, string? username = null, + int? profileId = null, int? objId = null, bool? profileActive = null) + { + var pos_list = await _repository.ReadAsync( + isReadonly: true, + withProfile: withProfile, withUser: withUser, withState: withState, + userId: userId, username: username, + profileId: profileId, objId: objId, profileActive: profileActive); + + var post_dto_list = _mapper.Map>(pos_list); + + return Result.Success(post_dto_list); + } } } \ No newline at end of file