From 638afa2ad58bb90a9cbb46f49d89727aa397a4fe Mon Sep 17 00:00:00 2001 From: "DESKTOP-G961P6V\\Zhh" <839860190@qq.com> Date: Wed, 13 Mar 2024 04:30:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A9=9A=E5=A7=BB=E7=8A=B6=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=8E=BB=E6=8E=89=E4=B8=BA=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaritalStatusesAppService.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Shentun.Peis.Application/MaritalStatuses/MaritalStatusesAppService.cs b/src/Shentun.Peis.Application/MaritalStatuses/MaritalStatusesAppService.cs index c5c10f7..dc82dcc 100644 --- a/src/Shentun.Peis.Application/MaritalStatuses/MaritalStatusesAppService.cs +++ b/src/Shentun.Peis.Application/MaritalStatuses/MaritalStatusesAppService.cs @@ -57,19 +57,14 @@ namespace Shentun.Peis.MaritalStatuses public async Task UpdateAsync(char Id, UpdateMaritalStatusDto input) { var ent = await _repository.GetAsync(m => m.Id == Id); - if (ent != null) - { - ent.SimpleCode = input.SimpleCode; - ent.DisplayName = input.DisplayName; - var newent = await _repository.UpdateAsync(ent); + ent.SimpleCode = input.SimpleCode; + ent.DisplayName = input.DisplayName; + + var newent = await _repository.UpdateAsync(ent); + + return ObjectMapper.Map(newent); - return ObjectMapper.Map(newent); - } - else - { - return ObjectMapper.Map(ent); - } }