From a9f12f873e29f578c01fa8f4e9e2bf85241eb82d Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 17 Dec 2020 13:47:56 +0800 Subject: [PATCH] Always use the repository method to update the changed entity. --- .../Volo/Abp/Identity/OrganizationUnitManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/OrganizationUnitManager.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/OrganizationUnitManager.cs index ec794a51df..3dee9a902c 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/OrganizationUnitManager.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/OrganizationUnitManager.cs @@ -114,7 +114,10 @@ namespace Volo.Abp.Identity foreach (var child in children) { child.Code = OrganizationUnit.AppendCode(organizationUnit.Code, OrganizationUnit.GetRelativeCode(child.Code, oldCode)); + await OrganizationUnitRepository.UpdateAsync(child); } + + await OrganizationUnitRepository.UpdateAsync(organizationUnit); } public virtual async Task GetCodeOrDefaultAsync(Guid id)