From 9f84d7bfae09de572d863f9bed9c3b011cc8c18c Mon Sep 17 00:00:00 2001 From: Savorboard Date: Mon, 18 Nov 2019 15:49:09 +0800 Subject: [PATCH] Update samples to netcoreapp3.0 --- .../Sample.AzureServiceBus.InMemory.csproj | 8 +++----- .../Sample.AzureServiceBus.InMemory/Startup.cs | 8 ++++++-- .../Sample.Kafka.MySql.csproj | 8 +++----- samples/Sample.Kafka.MySql/Startup.cs | 8 ++++++-- .../Sample.RabbitMQ.MongoDB.csproj | 6 ++---- samples/Sample.RabbitMQ.MongoDB/Startup.cs | 18 +++++++----------- .../ITransport.AzureServiceBus.cs | 1 - 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/samples/Sample.AzureServiceBus.InMemory/Sample.AzureServiceBus.InMemory.csproj b/samples/Sample.AzureServiceBus.InMemory/Sample.AzureServiceBus.InMemory.csproj index faa0a12..740cd66 100644 --- a/samples/Sample.AzureServiceBus.InMemory/Sample.AzureServiceBus.InMemory.csproj +++ b/samples/Sample.AzureServiceBus.InMemory/Sample.AzureServiceBus.InMemory.csproj @@ -1,16 +1,14 @@  - netcoreapp2.2 + netcoreapp3.0 NU1701 NU1701 - - - - + + diff --git a/samples/Sample.AzureServiceBus.InMemory/Startup.cs b/samples/Sample.AzureServiceBus.InMemory/Startup.cs index 4da741e..75b59f3 100644 --- a/samples/Sample.AzureServiceBus.InMemory/Startup.cs +++ b/samples/Sample.AzureServiceBus.InMemory/Startup.cs @@ -14,12 +14,16 @@ namespace Sample.AzureServiceBus.InMemory x.UseDashboard(); }); - services.AddMvc(); + services.AddControllers(); } public void Configure(IApplicationBuilder app) { - app.UseMvc(); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); } } } \ No newline at end of file diff --git a/samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj b/samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj index 4bb65ec..bf42fb7 100644 --- a/samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj +++ b/samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj @@ -1,15 +1,13 @@  - netcoreapp2.2 + netcoreapp3.0 NU1701 NU1701 - - - - + + diff --git a/samples/Sample.Kafka.MySql/Startup.cs b/samples/Sample.Kafka.MySql/Startup.cs index 3a6a8f7..edaf074 100644 --- a/samples/Sample.Kafka.MySql/Startup.cs +++ b/samples/Sample.Kafka.MySql/Startup.cs @@ -15,12 +15,16 @@ namespace Sample.Kafka.MySql x.UseDashboard(); }); - services.AddMvc(); + services.AddControllers(); } public void Configure(IApplicationBuilder app) { - app.UseMvc(); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); } } } \ No newline at end of file diff --git a/samples/Sample.RabbitMQ.MongoDB/Sample.RabbitMQ.MongoDB.csproj b/samples/Sample.RabbitMQ.MongoDB/Sample.RabbitMQ.MongoDB.csproj index 1725688..08b56d7 100644 --- a/samples/Sample.RabbitMQ.MongoDB/Sample.RabbitMQ.MongoDB.csproj +++ b/samples/Sample.RabbitMQ.MongoDB/Sample.RabbitMQ.MongoDB.csproj @@ -1,14 +1,12 @@  - netcoreapp2.2 + netcoreapp3.0 7.1 - - - + diff --git a/samples/Sample.RabbitMQ.MongoDB/Startup.cs b/samples/Sample.RabbitMQ.MongoDB/Startup.cs index da07bd3..bd80f11 100644 --- a/samples/Sample.RabbitMQ.MongoDB/Startup.cs +++ b/samples/Sample.RabbitMQ.MongoDB/Startup.cs @@ -1,7 +1,4 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using MongoDB.Driver; @@ -26,17 +23,16 @@ namespace Sample.RabbitMQ.MongoDB x.UseRabbitMQ("192.168.2.120"); x.UseDashboard(); }); - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + services.AddControllers(); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app) { - if (env.IsDevelopment()) + app.UseRouting(); + app.UseEndpoints(endpoints => { - app.UseDeveloperExceptionPage(); - } - - app.UseMvc(); + endpoints.MapControllers(); + }); } } } diff --git a/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs b/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs index 74b1f38..9e20c96 100644 --- a/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs +++ b/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs @@ -24,7 +24,6 @@ namespace DotNetCore.CAP.AzureServiceBus public AzureServiceBusTransport( ILogger logger, - IOptions options, IOptions asbOptions) { _logger = logger;