From ed0bea31d18347cd7344ed92cacf7d3702469db4 Mon Sep 17 00:00:00 2001 From: Isao Yamauchi Date: Tue, 17 Oct 2023 11:44:07 -0700 Subject: [PATCH 1/2] Revert "Bumping up HealthcareSharedPackageVersion to the latest." --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index edd3ae321d..f05048b22e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@ - 7.0.36 + 7.0.29 4.3.0 @@ -39,7 +39,7 @@ - + From fba990a5bb681a52fde39a361975771c1f13a0ce Mon Sep 17 00:00:00 2001 From: Isao Yamauchi Date: Thu, 19 Oct 2023 11:10:03 -0700 Subject: [PATCH 2/2] Changing AddFhirServer with an optional parameter for MVC. --- .../FhirServerServiceCollectionExtensions.cs | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.Health.Fhir.Shared.Api/Registration/FhirServerServiceCollectionExtensions.cs b/src/Microsoft.Health.Fhir.Shared.Api/Registration/FhirServerServiceCollectionExtensions.cs index 264c75f294..244fb6d4fe 100644 --- a/src/Microsoft.Health.Fhir.Shared.Api/Registration/FhirServerServiceCollectionExtensions.cs +++ b/src/Microsoft.Health.Fhir.Shared.Api/Registration/FhirServerServiceCollectionExtensions.cs @@ -43,25 +43,30 @@ public static class FhirServerServiceCollectionExtensions /// The services collection. /// An optional configuration root object. This method uses "FhirServer" section. /// An optional delegate to set properties after values have been loaded from configuration + /// An optional flag indicating wheter to register ASP.NET MVC components. /// A object. public static IFhirServerBuilder AddFhirServer( this IServiceCollection services, IConfiguration configurationRoot = null, - Action configureAction = null) + Action configureAction = null, + bool addMvc = true) { EnsureArg.IsNotNull(services, nameof(services)); services.AddOptions(); - services.AddMvc(options => - { - options.EnableEndpointRouting = false; - options.RespectBrowserAcceptHeader = true; - }) - .AddNewtonsoftJson(options => - { - options.SerializerSettings.DateParseHandling = Newtonsoft.Json.DateParseHandling.DateTimeOffset; - }) - .AddRazorRuntimeCompilation(); + if (addMvc) + { + services.AddMvc(options => + { + options.EnableEndpointRouting = false; + options.RespectBrowserAcceptHeader = true; + }) + .AddNewtonsoftJson(options => + { + options.SerializerSettings.DateParseHandling = Newtonsoft.Json.DateParseHandling.DateTimeOffset; + }) + .AddRazorRuntimeCompilation(); + } var fhirServerConfiguration = new FhirServerConfiguration();