private static void SeedGenres(ApplicationDbContext context) { var noGenre = new Models.Genre { Id = "none", Name = "None" }; context.Genres.AddOrUpdate( noGenre, new Models.Genre { Id = "action", Name = "Action" } ); context.Movies .Where(movie => movie.Genre == null) .ToList() .ForEach(movie => movie.Genre = noGenre); context.SaveChanges(); }
public Song(string title, int length, Genre genre) { this.Title = title; this.Length = length; this.Genre = genre; }