Browse Source

UserUpdate

zinab_elgendy 7 months ago
parent
commit
c6ed920b13

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

@@ -22,6 +22,8 @@ namespace MTWorkHR.Application.Mapper
 
 
             CreateMap<UserDto, ApplicationUser>()
             CreateMap<UserDto, ApplicationUser>()
                 .ForMember(m => m.UserRoles, op => op.Ignore())
                 .ForMember(m => m.UserRoles, op => op.Ignore())
+                .ForMember(m => m.UserAttachments, op => op.Ignore())
+                .ForMember(m => m.UserAddress, op => op.Ignore())
                 .ForMember(m => m.Id, op => op.Ignore());
                 .ForMember(m => m.Id, op => op.Ignore());
 
 
             CreateMap<ApplicationUser, UserDto>().ForMember(m => m.Password, op => op.Ignore())
             CreateMap<ApplicationUser, UserDto>().ForMember(m => m.Password, op => op.Ignore())

+ 1 - 1
MTWorkHR.Application/Services/User/UserService.cs

@@ -326,7 +326,7 @@ namespace MTWorkHR.Application.Services
         {
         {
             try
             try
             {
             {
-                var entity = await _userManager.Users.FirstOrDefaultAsync(x => x.Id == input.Id);
+                var entity = await _userManager.FindByIdAsync(input.Id);
 
 
                 if (entity == null)
                 if (entity == null)
                     throw new AppException(ExceptionEnum.RecordNotExist);
                     throw new AppException(ExceptionEnum.RecordNotExist);