Explorar el Código

Mapper for UserId

zinab_elgendy hace 2 semanas
padre
commit
44a211b485
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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>()