public static void Initialize(IServiceProvider serviceProvider) { using (var context = new TravelLogContext( serviceProvider.GetRequiredService <DbContextOptions <TravelLogContext> >())) { // Look for any movies. if (context.TravelItems.Count() > 0) { return; // DB has been seeded } context.TravelItems.AddRange( new TravelItems { Title = "Is Mayo an Instrument?", Url = "https://i.kym-cdn.com/photos/images/original/001/371/723/be6.jpg", Tags = "spongebob", Uploaded = "07-10-18 4:20T18:25:43.511Z", Width = "768", Height = "432" } ); context.SaveChanges(); } }