diff --git a/src/WorkFlow.Application/Profiles/ReadProfileQuery.cs b/src/WorkFlow.Application/Profiles/ReadProfileQuery.cs index b3c1fed..7cfd4f3 100644 --- a/src/WorkFlow.Application/Profiles/ReadProfileQuery.cs +++ b/src/WorkFlow.Application/Profiles/ReadProfileQuery.cs @@ -57,15 +57,10 @@ public class ReadProfileHandler : IRequestHandler if (request.IncludeObject && profile.Id is int profileId) profile.Objects = await _objRepository.ReadAsync(request.UserId, profileId, cancel); - var profileDto = _mapper.Map(profile); - if (profile.Id is int pId) - { - var bttns = await _bttnRepository.Read(b => b.ProfileId == pId).ToListAsync(cancel); - profileDto.Buttons = _mapper.Map>(bttns); - } + profile.Buttons = await _bttnRepository.Read(b => b.ProfileId == pId).ToListAsync(cancel); - return profileDto; + return _mapper.Map(profile); } } diff --git a/src/WorkFlow.Domain/Entities/Profile.cs b/src/WorkFlow.Domain/Entities/Profile.cs index 6f4204b..d0ebd98 100644 --- a/src/WorkFlow.Domain/Entities/Profile.cs +++ b/src/WorkFlow.Domain/Entities/Profile.cs @@ -27,4 +27,7 @@ public class Profile [NotMapped] public IEnumerable? Objects { get; set; } + + [NotMapped] + public IEnumerable