From 6e33a1a7f691dab35ff2ac566b6eebe401960f6a Mon Sep 17 00:00:00 2001 From: Savorboard Date: Mon, 9 Oct 2017 23:12:58 +0800 Subject: [PATCH] update sample. --- samples/Sample.RabbitMQ.MySql/Program.cs | 17 +++++------------ samples/Sample.RabbitMQ.MySql/Startup.cs | 8 -------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/samples/Sample.RabbitMQ.MySql/Program.cs b/samples/Sample.RabbitMQ.MySql/Program.cs index 0f7c032..94095e2 100644 --- a/samples/Sample.RabbitMQ.MySql/Program.cs +++ b/samples/Sample.RabbitMQ.MySql/Program.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -13,20 +14,12 @@ namespace Sample.RabbitMQ.MySql { public static void Main(string[] args) { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables("ASPNETCORE_") - .Build(); + BuildWebHost(args).Run(); + } - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) .UseStartup() .Build(); - - host.Run(); - } } } diff --git a/samples/Sample.RabbitMQ.MySql/Startup.cs b/samples/Sample.RabbitMQ.MySql/Startup.cs index 0974510..12a2986 100644 --- a/samples/Sample.RabbitMQ.MySql/Startup.cs +++ b/samples/Sample.RabbitMQ.MySql/Startup.cs @@ -20,14 +20,6 @@ namespace Sample.RabbitMQ.MySql x.UseEntityFramework(); x.UseRabbitMQ("localhost"); x.UseDashboard(); - x.UseDiscovery(d => - { - d.DiscoveryServerHostName = "localhost"; - d.DiscoveryServerPort = 8500; - d.CurrentNodeHostName = "localhost"; - d.CurrentNodePort = 5800; - d.NodeName = "CAP 1号节点"; - }); }); services.AddMvc();