Created
February 1, 2019 02:21
-
-
Save jioo/030d00168ee046aff12c9b33aed47260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var seed = args.Contains("/seed"); | |
if (seed) | |
args = args.Except(new[] { "/seed" }).ToArray(); | |
var host = BuildWebHost(args); | |
if (seed) | |
SeedData.InitializeDatabase(host.Services); | |
host.Run(); | |
} | |
public static IWebHost BuildWebHost(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.UseStartup<Startup>() | |
.Build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment