diff --git a/framework/src/Volo.Abp.Data/Volo/Abp/Data/ConcurrencyStampExtensions.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Data/ConcurrencyStampExtensions.cs new file mode 100644 index 0000000000..0d97d3a68a --- /dev/null +++ b/framework/src/Volo.Abp.Data/Volo/Abp/Data/ConcurrencyStampExtensions.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities; +using JetBrains.Annotations; + +namespace Volo.Abp.Data +{ + public static class ConcurrencyStampExtensions + { + public static void SetConcurrencyStampIfNotNull(this IHasConcurrencyStamp entity, [CanBeNull] string concurrencyStamp) + { + if (!concurrencyStamp.IsNullOrEmpty()) + { + entity.ConcurrencyStamp = concurrencyStamp; + } + } + } +} diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs index 512d646ff2..7b86f8f3fd 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Domain.Entities; using Volo.Abp.Identity; using Volo.Abp.Validation; @@ -28,7 +29,7 @@ namespace Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.P return View("~/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml", model); } - public class PersonalInfoModel + public class PersonalInfoModel : IHasConcurrencyStamp { [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] @@ -51,6 +52,9 @@ namespace Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.P [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "DisplayName:PhoneNumber")] public string PhoneNumber { get; set; } + + [HiddenInput] + public string ConcurrencyStamp { get; set; } } } } diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml index 33ca670b0c..ec65f49834 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml @@ -19,6 +19,8 @@