React to WebHostBuilder
This commit is contained in:
parent
cedfd88254
commit
69d42502a6
|
|
@ -11,14 +11,22 @@ namespace MusicStore
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
|
public Program(IServiceProvider serviceProvider)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
public Task<int> Main(string[] args)
|
public Task<int> Main(string[] args)
|
||||||
{
|
{
|
||||||
//Add command line configuration source to read command line parameters.
|
//Add command line configuration source to read command line parameters.
|
||||||
var config = new Configuration();
|
var config = new Configuration();
|
||||||
config.AddCommandLine(args);
|
config.AddCommandLine(args);
|
||||||
|
|
||||||
using (WebHost.CreateEngine(config)
|
using (new WebHostBuilder(_serviceProvider, config)
|
||||||
.UseServer("Microsoft.AspNet.Server.WebListener")
|
.UseServer("Microsoft.AspNet.Server.WebListener")
|
||||||
|
.Build()
|
||||||
.Start())
|
.Start())
|
||||||
{
|
{
|
||||||
Console.WriteLine("Started the server..");
|
Console.WriteLine("Started the server..");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue