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);