Say I have some code like this from an ASP.NET MVC Core app:
public static void Main(string[] args)
{
Console.Title = "IdentityServerWithAspNetIdentity";
var seed = args.Any(x => x == "/seed");
if (seed) args = args.Except(new[] { "/seed" }).ToArray();
var host = BuildWebHost(args);
if (seed)
{
SeedData.EnsureSeedData(host.Services);
return;
}
host.Run();
}
How do I pass an arguement of "/seed" to this method (to seed the data)? So far I have tried:
1) This:
No arguement is passed to Main.
2) Looked here (amongst other places):