diff --git a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll index b7cc055fbd..9b260304f6 100644 Binary files a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll and b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll differ diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs index c620ebd917..afe51f01ea 100644 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs +++ b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs @@ -10,5 +10,7 @@ namespace Volo.Abp.Identity Task> GetRolesAsync(Guid id); Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input); + + Task GetUserForCreateOrUpdateAsync(Guid? id); } } diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateOutput.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateOutput.cs index e107db6b71..7a390bbc25 100644 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateOutput.cs +++ b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateOutput.cs @@ -2,7 +2,7 @@ namespace Volo.Abp.Identity { - public class IdentityUserCreateOrUpdateOutput: EntityDto + public class IdentityUserCreateOrUpdateOutput { public IdentityUserDto User { get; set; } diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs index 68b92a04c5..af2150a6cf 100644 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs +++ b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs @@ -29,7 +29,7 @@ namespace Volo.Abp.Identity ); } - public async Task GetUserForCreateOrUpdateAsync(Guid id) + public async Task GetUserForCreateOrUpdateAsync(Guid? id) { var userRoleDtos = ObjectMapper.Map, IdentityUserRoleDto[]>(await _roleRepository.GetListAsync()); var output = new IdentityUserCreateOrUpdateOutput @@ -37,8 +37,9 @@ namespace Volo.Abp.Identity Roles = userRoleDtos }; - var user = await _userManager.GetByIdAsync(id); + if (!id.HasValue) return output; + var user = await _userManager.GetByIdAsync(id.Value); output.User = ObjectMapper.Map(user); foreach (var userRoleDto in userRoleDtos) diff --git a/src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs b/src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs index 300395bf19..48ab86f57a 100644 --- a/src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs +++ b/src/Volo.Abp.Identity.Web/Areas/Identity/Controllers/UsersController.cs @@ -22,7 +22,9 @@ namespace Volo.Abp.Identity.Web.Areas.Identity.Controllers public async Task _Create() { - return PartialView(); + var identityUser = await _identityUserAppService.GetUserForCreateOrUpdateAsync(null); + + return PartialView(identityUser); } public async Task _Update(Guid id) diff --git a/src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/_Create.cshtml b/src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/_Create.cshtml index 623fae0570..3df61db2ab 100644 --- a/src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/_Create.cshtml +++ b/src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/_Create.cshtml @@ -1,4 +1,4 @@ -@model Volo.Abp.Identity.IdentityUserDto +@model Volo.Abp.Identity.IdentityUserCreateOrUpdateOutput