public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); using (var client = new LeaderboardAPIContext()) { client.Database.EnsureCreated(); client.Database.Migrate(); } this.hostingEnvironment = env; }
public RecordsController(LeaderboardAPIContext context) { _context = context; }