diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index a2aa0f257..958a967a2 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -93,10 +93,10 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk("The mailbox for this user type already exists"); } - await _userRepository.UpdatePartialFields(_userInfo.Id, u => new User() + await _userRepository.UpdatePartialFieldsNowAsync(_userInfo.Id, u => new User() { EMail = newEmail - }, true); + }); //删除验证码历史记录 await _verificationCodeRepository.BatchDeleteAsync(t => t.UserId == _userInfo.Id && t.CodeType == 0); @@ -113,10 +113,10 @@ namespace IRaCIS.Application.Services { - await _userRepository.UpdatePartialFields(_userInfo.Id, u => new User() + await _userRepository.UpdatePartialFieldsNowAsync(_userInfo.Id, u => new User() { Phone = newPhone - },true); + }); return ResponseOutput.Ok(); } @@ -130,10 +130,10 @@ namespace IRaCIS.Application.Services { return ResponseOutput.NotOk("UserId already exists"); } - await _userRepository.UpdatePartialFields(_userInfo.Id, u => new User() + await _userRepository.UpdatePartialFieldsNowAsync(_userInfo.Id, u => new User() { UserName = newUserName - },true); + }); return ResponseOutput.Ok(); } @@ -148,11 +148,11 @@ namespace IRaCIS.Application.Services public async Task ResetPassword(Guid userId) { - await _userRepository.UpdatePartialFields(userId, u => new User() + await _userRepository.UpdatePartialFieldsNowAsync(userId, u => new User() { Password = MD5Helper.Md5(StaticData.DefaultPassword), IsFirstAdd = true - }, true); + }); return ResponseOutput.Ok(); } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index c668ec0f3..7a7cdc276 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -248,7 +248,7 @@ namespace IRaCIS.Core.Application public async Task AbandonTrial(Guid trialId, /*Guid? signId,*/ bool isAbandon) { - await _trialRepository.UpdatePartialFields(trialId, u => new Trial() { IsDeleted = isAbandon },true); + await _trialRepository.UpdatePartialFieldsNowAsync(trialId, u => new Trial() { IsDeleted = isAbandon }); //var success = await _repository.BatchUpdateAsync(t => t.Id == signId, u => new TrialSign() { IsCompleted = true }); diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitImageDateTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitImageDateTrigger.cs index 5233ddcce..a03ba6afb 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitImageDateTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitImageDateTrigger.cs @@ -21,7 +21,7 @@ namespace IRaCIS.Core.Application.Triggers { await UpdateSubjectVisitImageDateAsync(context.Entity.SubjectVisitId); - await _subjectVisitRepository.UpdatePartialFieldsNow(subjectVisitId, u => new SubjectVisit() + await _subjectVisitRepository.UpdatePartialFieldsNowAsync(subjectVisitId, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.Executed }); @@ -43,7 +43,7 @@ namespace IRaCIS.Core.Application.Triggers { await UpdateSubjectVisitImageDateAsync(subjectVisitId); - await _subjectVisitRepository.UpdatePartialFieldsNow(subjectVisitId, u => new SubjectVisit() + await _subjectVisitRepository.UpdatePartialFieldsNowAsync(subjectVisitId, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.Executed }); @@ -84,7 +84,7 @@ namespace IRaCIS.Core.Application.Triggers var minArray = new DateTime?[] { svTime.DicomStudyMinStudyTime, svTime.NoneDicomStudyMinStudyTime }; var maxArray = new DateTime?[] { svTime.DicomStudyMaxStudyTime, svTime.NoneDicomStudyMaxStudyTime }; - await _subjectVisitRepository.UpdatePartialFieldsNow(subjectVisitId, u => new SubjectVisit() + await _subjectVisitRepository.UpdatePartialFieldsNowAsync(subjectVisitId, u => new SubjectVisit() { EarliestScanDate = minArray.Min(), diff --git a/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs index 48a3dc141..29e2f174a 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs @@ -18,14 +18,14 @@ namespace IRaCIS.Core.Infra.EFCore Task UpdateFromDTOAsync(TFrom from, bool autoSave = false, bool ignoreDtoNullProperty = true, params EntityVerifyExp[] verify); - Task UpdatePartialFields(TEntity entity, string[] propertyNames, bool autoSave = false, bool ignoreEntityNullProperty = true, params EntityVerifyExp[] verify); + Task UpdatePartialFieldsAsync(TEntity entity, string[] propertyNames, bool autoSave = false, bool ignoreEntityNullProperty = true, params EntityVerifyExp[] verify); /// 更新字段,立即提交事务 - Task UpdatePartialFieldsNow(Guid id, Expression> updateFactory, params EntityVerifyExp[] verify); + Task UpdatePartialFieldsNowAsync(Guid id, Expression> updateFactory, params EntityVerifyExp[] verify); /// 更新字段,默认不提交事务,一般用于服务里面 和别的操作 一起提交事务 - Task UpdatePartialFields(Guid id, Expression> updateFactory, bool autoSave = false, params EntityVerifyExp[] verify); + Task UpdatePartialFieldsAsync(Guid id, Expression> updateFactory, bool autoSave = false, params EntityVerifyExp[] verify); /// 批量删除,相当于原生sql, 没用EF跟踪方式(所有查询出来,再删除 浪费性能) Task BatchDeleteAsync(Expression> deleteFilter); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index 8ece566a4..49514d9be 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -460,7 +460,7 @@ namespace IRaCIS.Core.Infra.EFCore /// /// /// - public async Task UpdatePartialFields(Guid id, Expression> updateFactory, bool autoSave = false, params EntityVerifyExp[] verify) + public async Task UpdatePartialFieldsAsync(Guid id, Expression> updateFactory, bool autoSave = false, params EntityVerifyExp[] verify) { await SetPartialFieldUpdateAsync(id, updateFactory, verify); @@ -468,7 +468,7 @@ namespace IRaCIS.Core.Infra.EFCore } - public async Task UpdatePartialFieldsNow(Guid id, Expression> updateFactory, + public async Task UpdatePartialFieldsNowAsync(Guid id, Expression> updateFactory, params EntityVerifyExp[] verify) { await SetPartialFieldUpdateAsync(id, updateFactory, verify); @@ -534,7 +534,7 @@ namespace IRaCIS.Core.Infra.EFCore /// /// /// - public async Task UpdatePartialFields(TEntity entity, string[] propertyNames, + public async Task UpdatePartialFieldsAsync(TEntity entity, string[] propertyNames, bool autoSave = false, bool ignoreEntityNullProperty = true, params EntityVerifyExp[] verify) { await EntityVerifyAsync(false, verify, entity.Id);