diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index be89b76e3..af047ad5f 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -43,7 +43,6 @@ if (string.IsNullOrWhiteSpace(enviromentName)) ? args[index + 1] : "Development"; } - #endregion var builder = WebApplication.CreateBuilder(new WebApplicationOptions @@ -51,11 +50,23 @@ var builder = WebApplication.CreateBuilder(new WebApplicationOptions EnvironmentName = enviromentName }); +#region 兼容windows 服务命令行的方式 + +var urlsIndex = Array.IndexOf(args, "--urls"); +if (urlsIndex > -1) +{ + builder.WebHost.UseUrls(args[urlsIndex + 1]); +} +// +#endregion + #region 主机配置 NewId.SetProcessIdProvider(new CurrentProcessIdProvider()); + + builder.Host .ConfigureAppConfiguration((hostContext, config) => { diff --git a/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs b/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs index 1c17ceebe..8749571be 100644 --- a/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs @@ -23,9 +23,9 @@ namespace IRaCIS.Application.Services public async Task GetResearchPublication(Guid doctorId) { var doctorScientificResearchInfo = await researchPublicationRepository.Where(o => o.DoctorId == doctorId) - .ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); + .ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); - return doctorScientificResearchInfo; + return doctorScientificResearchInfo!; }