diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index ecca325a5..67054d8f4 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -172,7 +172,10 @@ namespace IRaCIS.Application.Contracts public List AccountList { get; set; } - public List HospitalGroupIdList { get; set; } + public List HospitalGroupIdList => HospitalGroupList.Select(t => t.HospitalGroupId).ToList(); + + + public List HospitalGroupList { get; set; } = new List(); } public class UserInfo diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index ca442aa59..bbac2a38c 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -74,7 +74,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.UserType, u => u.MapFrom(t => t.UserTypeName)); CreateMap() - .ForMember(d => d.HospitalGroupIdList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t => t.HospitalGroupId))); + .ForMember(d => d.HospitalGroupList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t => new UserHospitalGroupInfo() { HospitalGroupId = t.HospitalGroupId, IsDisabled = t.IsDisabled }))); CreateMap()