瀏覽代碼

UserUpdate

zinab_elgendy 7 月之前
父節點
當前提交
c6ed920b13
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 0
      MTWorkHR.Application/Mapper/MappingProfile.cs
  2. 1 1
      MTWorkHR.Application/Services/User/UserService.cs

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

@@ -22,6 +22,8 @@ namespace MTWorkHR.Application.Mapper
 
             CreateMap<UserDto, ApplicationUser>()
                 .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());
 
             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
             {
-                var entity = await _userManager.Users.FirstOrDefaultAsync(x => x.Id == input.Id);
+                var entity = await _userManager.FindByIdAsync(input.Id);
 
                 if (entity == null)
                     throw new AppException(ExceptionEnum.RecordNotExist);