From 617764126b9576717d0933968236f592d0d675fa Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 19 Apr 2022 17:33:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs | 2 +- IRaCIS.Core.Infra.EFCore/Repository/Repository.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs index 2cc7bc03..64191ae9 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs @@ -19,7 +19,7 @@ namespace IRaCIS.Core.API //处理返回给前端 可空类型 给出默认值 比如in? 为null 设置 默认值0 options.SerializerSettings.ContractResolver = new NullToEmptyStringResolver(); //new DefaultContractResolver();// new NullToEmptyStringResolver(); // 设置时间格式 - options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; + options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss.fff"; //options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index 98e53bef..7d95140f 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -228,7 +228,7 @@ namespace IRaCIS.Core.Infra.EFCore #region 测试中心名称 - Data.SiteCode = (await _dbContext.TrialSite.FirstOrDefaultAsync(x => x.TrialId == Data.TrialId && x.SiteId == Data.SiteId))?.TrialSiteCode; + Data.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().FirstOrDefaultAsync(x => x.TrialId == Data.TrialId && x.SiteId == Data.SiteId))?.TrialSiteCode; var sitedata = await _dbContext.Site.FirstOrDefaultAsync(x => x.Id == Data.SiteId); @@ -577,6 +577,8 @@ namespace IRaCIS.Core.Infra.EFCore return entities; } + + public async Task AddRangeAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) { await _dbSet.AddRangeAsync(entities).ConfigureAwait(false);