diff --git a/src/SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/O2NextGen.Sdk.NetCore.Models.csproj b/src/SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/O2NextGen.Sdk.NetCore.Models.csproj index 84a4445b..e3d50db2 100644 --- a/src/SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/O2NextGen.Sdk.NetCore.Models.csproj +++ b/src/SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/O2NextGen.Sdk.NetCore.Models.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp3.1 diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/IoC/ServiceCollectionExtensions.cs b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/IoC/ServiceCollectionExtensions.cs index f20c0057..41739ca2 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/IoC/ServiceCollectionExtensions.cs +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/IoC/ServiceCollectionExtensions.cs @@ -3,6 +3,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; using O2NextGen.CertificateManagement.Api.Filters; using O2NextGen.CertificateManagement.Business.Services; using O2NextGen.CertificateManagement.Data; @@ -32,10 +34,19 @@ public static IServiceCollection AddRequiredMvcComponents(this IServiceCollectio { services.AddTransient(); - var mvcBuilder = services.AddMvcCore(options => { options.Filters.Add(); }); + var mvcBuilder = services + .AddMvcCore(options => + { + options.Filters.Add(); + }); + mvcBuilder.AddApiExplorer(); //for swagger - mvcBuilder.SetCompatibilityVersion(CompatibilityVersion.Version_2_2); - mvcBuilder.AddJsonFormatters(); + mvcBuilder.SetCompatibilityVersion(CompatibilityVersion.Version_3_0); + mvcBuilder.AddNewtonsoftJson(o => + { + o.SerializerSettings.Converters.Add(new StringEnumConverter()); + o.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + }); return services; } diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj index ba989a7c..eab7d81a 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj @@ -1,13 +1,14 @@  - netcoreapp2.2 + netcoreapp3.1 e238f36a-3514-4436-b624-9b4f799bb82d Linux ..\..\.. ..\..\..\docker-compose.dcproj + @@ -28,6 +29,7 @@ + @@ -56,6 +58,7 @@ + diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Program.cs b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Program.cs index 6294804b..cd8ff93b 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Program.cs +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Program.cs @@ -18,7 +18,7 @@ public static async Task Main(string[] args) try { - var host = CreateWebHostBuilder(args).Build(); + var host = CreateHostBuilder(args); Log.Information($"############### {AppName} ##############"); Log.Information("################# Starting Application #################"); await host.EnsureDbUpdate(); @@ -37,12 +37,13 @@ public static async Task Main(string[] args) } } - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + public static IWebHost CreateHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseSerilog((context, configuration) => { configuration.ReadFrom.Configuration(context.Configuration); }) - .UseStartup(); // <- Add this line + .UseStartup() + .Build(); } } diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Startup.cs b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Startup.cs index 91a4200e..615f3ad4 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Startup.cs +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Api/Startup.cs @@ -86,7 +86,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) await next.Invoke(); }); - app.UseMvc(); + app.UseRouting(); + app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } } \ No newline at end of file diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Business/O2NextGen.CertificateManagement.Business.csproj b/src/Services/c-gen/O2NextGen.CertificateManagement.Business/O2NextGen.CertificateManagement.Business.csproj index 37c6e8da..71f19599 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Business/O2NextGen.CertificateManagement.Business.csproj +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Business/O2NextGen.CertificateManagement.Business.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Data/O2NextGen.CertificateManagement.Data.csproj b/src/Services/c-gen/O2NextGen.CertificateManagement.Data/O2NextGen.CertificateManagement.Data.csproj index 68520b18..6ac5a3a7 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Data/O2NextGen.CertificateManagement.Data.csproj +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Data/O2NextGen.CertificateManagement.Data.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 diff --git a/src/Services/c-gen/O2NextGen.CertificateManagement.Impl/O2NextGen.CertificateManagement.Impl.csproj b/src/Services/c-gen/O2NextGen.CertificateManagement.Impl/O2NextGen.CertificateManagement.Impl.csproj index c29078c1..9ffe7a09 100644 --- a/src/Services/c-gen/O2NextGen.CertificateManagement.Impl/O2NextGen.CertificateManagement.Impl.csproj +++ b/src/Services/c-gen/O2NextGen.CertificateManagement.Impl/O2NextGen.CertificateManagement.Impl.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 diff --git a/src/Services/c-gen/Tests/IntegrationTests.O2NextGen.CertificateManagement.Api/IntegrationTests.O2NextGen.CertificateManagement.Api.csproj b/src/Services/c-gen/Tests/IntegrationTests.O2NextGen.CertificateManagement.Api/IntegrationTests.O2NextGen.CertificateManagement.Api.csproj index f00cd14e..797f72ff 100644 --- a/src/Services/c-gen/Tests/IntegrationTests.O2NextGen.CertificateManagement.Api/IntegrationTests.O2NextGen.CertificateManagement.Api.csproj +++ b/src/Services/c-gen/Tests/IntegrationTests.O2NextGen.CertificateManagement.Api/IntegrationTests.O2NextGen.CertificateManagement.Api.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 false diff --git a/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Api/Tests.O2NextGen.CertificateManagement.Api.csproj b/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Api/Tests.O2NextGen.CertificateManagement.Api.csproj index 263a4732..21dbea45 100644 --- a/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Api/Tests.O2NextGen.CertificateManagement.Api.csproj +++ b/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Api/Tests.O2NextGen.CertificateManagement.Api.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 false diff --git a/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Impl/Tests.O2NextGen.CertificateManagement.Impl.csproj b/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Impl/Tests.O2NextGen.CertificateManagement.Impl.csproj index 263a4732..21dbea45 100644 --- a/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Impl/Tests.O2NextGen.CertificateManagement.Impl.csproj +++ b/src/Services/c-gen/Tests/Tests.O2NextGen.CertificateManagement.Impl/Tests.O2NextGen.CertificateManagement.Impl.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 false