Skip to content

Commit fa5d4fd

Browse files
authored
Update Program.cs for EF
1 parent 7ca7f32 commit fa5d4fd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/CheeseMVC/Program.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
55
using System.Threading.Tasks;
66
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.AspNetCore;
78

89
namespace CheeseMVC
910
{
1011
public class Program
1112
{
1213
public static void Main(string[] args)
1314
{
14-
var host = new WebHostBuilder()
15-
.UseKestrel()
16-
.UseContentRoot(Directory.GetCurrentDirectory())
17-
.UseIISIntegration()
15+
BuildWebHost(args).Run();
16+
}
17+
18+
public static IWebHost BuildWebHost(string[] args) =>
19+
WebHost.CreateDefaultBuilder(args)
1820
.UseStartup<Startup>()
1921
.Build();
20-
21-
host.Run();
22-
}
2322
}
2423
}

0 commit comments

Comments
 (0)