From c1aa7525a5fa478b9dc6c9bfda10ce940c9c2b79 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 19 Feb 2021 15:17:14 +0800 Subject: [PATCH] Make RegisterDto of account module extensible. --- .../Volo/Abp/Account/RegisterDto.cs | 5 +++-- .../Volo/Abp/Account/AccountAppService.cs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs index b69383d26f..ed2697a8d8 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs @@ -1,11 +1,12 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Auditing; using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; using Volo.Abp.Validation; namespace Volo.Abp.Account { - public class RegisterDto + public class RegisterDto : ExtensibleObject { [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] @@ -25,4 +26,4 @@ namespace Volo.Abp.Account [Required] public string AppName { get; set; } } -} \ No newline at end of file +} diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs index 731c64fc52..05ff98b35b 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs @@ -6,6 +6,7 @@ using Volo.Abp.Account.Localization; using Volo.Abp.Account.Settings; using Volo.Abp.Application.Services; using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; using Volo.Abp.Settings; namespace Volo.Abp.Account @@ -42,6 +43,8 @@ namespace Volo.Abp.Account var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id); + input.MapExtraPropertiesTo(user); + (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); await UserManager.SetEmailAsync(user,input.EmailAddress);