From fd19d977fd866bbe2d9a0663a6c9a5b255a3e4a7 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Tue, 5 Jun 2018 10:17:30 +0800 Subject: [PATCH] Upgrade samples to .net core 2.1 --- .../Controllers/ValuesController.cs | 2 +- samples/Sample.Kafka.MySql/Program.cs | 6 ------ .../Sample.Kafka.MySql/Sample.Kafka.MySql.csproj | 15 +++------------ .../Controllers/ValuesController.cs | 3 +-- samples/Sample.RabbitMQ.MySql/Program.cs | 6 ------ .../Sample.RabbitMQ.MySql.csproj | 12 +++--------- samples/Sample.RabbitMQ.MySql/Startup.cs | 3 --- 7 files changed, 8 insertions(+), 39 deletions(-) diff --git a/samples/Sample.Kafka.MySql/Controllers/ValuesController.cs b/samples/Sample.Kafka.MySql/Controllers/ValuesController.cs index 6f04946..21510bb 100644 --- a/samples/Sample.Kafka.MySql/Controllers/ValuesController.cs +++ b/samples/Sample.Kafka.MySql/Controllers/ValuesController.cs @@ -34,7 +34,7 @@ namespace Sample.Kafka.MySql.Controllers return Ok("publish successful!"); } - [CapSubscribe("xxx.xxx.test2")] + [CapSubscribe("#.test2")] public void Test2(int value) { Console.WriteLine("Subscriber output message: " + value); diff --git a/samples/Sample.Kafka.MySql/Program.cs b/samples/Sample.Kafka.MySql/Program.cs index 976b20a..e7be245 100644 --- a/samples/Sample.Kafka.MySql/Program.cs +++ b/samples/Sample.Kafka.MySql/Program.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using NLog.Web; namespace Sample.Kafka.MySql { @@ -15,11 +14,6 @@ namespace Sample.Kafka.MySql public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() - .ConfigureLogging((hostingContext, builder) => - { - hostingContext.HostingEnvironment.ConfigureNLog("nlog.config"); - }) - .UseNLog() .Build(); } } \ 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 bf80ce5..e4a70df 100644 --- a/samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj +++ b/samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj @@ -1,29 +1,20 @@  - netcoreapp2.0 + netcoreapp2.1 Sample.Kafka.MySql NU1701 NU1701 - + - - - - - + - - - PreserveNewest - - diff --git a/samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs b/samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs index 1b47e5e..03f33c0 100644 --- a/samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs +++ b/samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs @@ -25,7 +25,6 @@ namespace Sample.RabbitMQ.MySql.Controllers return Ok(); } - [Route("~/publish2")] public IActionResult PublishMessage2() { @@ -47,7 +46,7 @@ namespace Sample.RabbitMQ.MySql.Controllers } [NonAction] - [CapSubscribe("sample.rabbitmq.mysql")] + [CapSubscribe("#.rabbitmq.mysql")] public void ReceiveMessage(DateTime time) { Console.WriteLine("[sample.rabbitmq.mysql] message received: " + DateTime.Now + ",sent time: " + time); diff --git a/samples/Sample.RabbitMQ.MySql/Program.cs b/samples/Sample.RabbitMQ.MySql/Program.cs index 3cbbe15..4e25d5c 100644 --- a/samples/Sample.RabbitMQ.MySql/Program.cs +++ b/samples/Sample.RabbitMQ.MySql/Program.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using NLog.Web; namespace Sample.RabbitMQ.MySql { @@ -14,11 +13,6 @@ namespace Sample.RabbitMQ.MySql public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() - .ConfigureLogging((hostingContext, builder) => - { - hostingContext.HostingEnvironment.ConfigureNLog("nlog.config"); - }) - .UseNLog() .Build(); } } diff --git a/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj b/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj index 5c981a3..3b11738 100644 --- a/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj +++ b/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 @@ -10,9 +10,8 @@ - - - + + @@ -22,10 +21,5 @@ - - - PreserveNewest - - diff --git a/samples/Sample.RabbitMQ.MySql/Startup.cs b/samples/Sample.RabbitMQ.MySql/Startup.cs index 6525770..554a624 100644 --- a/samples/Sample.RabbitMQ.MySql/Startup.cs +++ b/samples/Sample.RabbitMQ.MySql/Startup.cs @@ -23,9 +23,6 @@ namespace Sample.RabbitMQ.MySql public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { - loggerFactory.AddConsole(); - loggerFactory.AddDebug(); - app.UseMvc(); app.UseCap();