浏览代码

Mapper for UserId

zinab_elgendy 2 周之前
父节点
当前提交
44a211b485
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      MTWorkHR.Application/Mapper/MappingProfile.cs

+ 2 - 1
MTWorkHR.Application/Mapper/MappingProfile.cs

@@ -54,7 +54,8 @@ namespace MTWorkHR.Application.Mapper
             CreateMap<UserBasicInfoDto, ApplicationUser>().ReverseMap();
             CreateMap<UserBasicInfoDto, UserDto>().ReverseMap();
 
-            CreateMap<ApplicationUser, ChatUserDto>().ReverseMap();
+            CreateMap<ApplicationUser, ChatUserDto>()
+            .ForMember(s => s.UserId, o => o.MapFrom(s => s.Id )).ReverseMap();
             
             CreateMap<AttachmentDto, UserAttachment>().ReverseMap();
             CreateMap<UserAddress, UserAddressDto>()