public MyDbContext(DbContextOptions options) : base(options) { // this really should be somewhere else Database.EnsureCreated(); if (!WeatherForecasts.Any()) { WeatherForecasts.AddRange(WeatherForecast.SeedWeatherForecasts()); } SaveChanges(); }