Skip to content

Instantly share code, notes, and snippets.

@jioo
Created February 1, 2019 02:21
Show Gist options
  • Save jioo/030d00168ee046aff12c9b33aed47260 to your computer and use it in GitHub Desktop.
Save jioo/030d00168ee046aff12c9b33aed47260 to your computer and use it in GitHub Desktop.
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