From 309216b360866f28f054b2c60a2c5dfd7af3e1bf Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 19 Apr 2022 17:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E9=87=8F=E6=B7=BB=E5=8A=A0bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/WorkLoad/DoctorWorkloadService.cs | 3 --- IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs | 4 ++++ .../IRaCIS.Core.Infra.EFCore.csproj | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs index 18f4c4e11..f4f9c605f 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs @@ -629,7 +629,6 @@ namespace IRaCIS.Application.Services t => t.DoctorId == workLoadAddOrUpdateModel.DoctorId && t.TrialId == workLoadAddOrUpdateModel.TrialId, u => new Enroll() { EnrollStatus = (int)EnrollStatus.DoctorReading, - UpdateTime = DateTime.Now }); var success = await _doctorWorkloadRepository.SaveChangesAsync(); @@ -665,8 +664,6 @@ namespace IRaCIS.Application.Services Downtime = workLoadAddOrUpdateModel.Downtime, Training = workLoadAddOrUpdateModel.Training, Global = workLoadAddOrUpdateModel.Global, - UpdateTime = DateTime.Now, - UpdateUserId = userId, WorkTime = workLoadAddOrUpdateModel.WorkTime, YearMonth = yearMonthStr diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index a7785f634..c8f1d1f3a 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.ChangeTracking; using System.Reflection; +using EntityFramework.Exceptions.SqlServer; using IRaCIS.Core.Domain.Share; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -35,8 +36,11 @@ namespace IRaCIS.Core.Infra.EFCore protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseLoggerFactory(MyLoggerFactory) + .ReplaceService(); + optionsBuilder.UseExceptionProcessor(); + //var config = new ConfigurationBuilder() // .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true).Build(); //connectionString = config.GetSection("ConnectionStrings:RemoteNew").Value; diff --git a/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj b/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj index e67fa9b60..a04961a99 100644 --- a/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj +++ b/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj @@ -17,16 +17,16 @@ - - - + + + + - - + + -