public MoviesController(EntityBoxContext context) { _context = context; if (!_context.Movies.Any()) { _context.Movies.Add(new Movie { Slug = "american-beauty", Title = "American Beauty" }); _context.Movies.Add(new Movie { Slug = "12-angry-man", Title = "12 Angry Man" }); _context.SaveChanges(); } }
public PersonsController(EntityBoxContext context) { _context = context; if (!_context.Persons.Any()) { _context.Persons.Add(new Person { Slug = "john", Name = "John" }); _context.Persons.Add(new Person { Slug = "doe", Name = "Doe" }); _context.SaveChanges(); } }
public CountriesController(EntityBoxContext context) { _context = context; if (!_context.Countries.Any()) { _context.Countries.Add(new Country { Slug = "portugal", Name = "Portugal" }); _context.Countries.Add(new Country { Slug = "spain", Name = "Spain" }); _context.SaveChanges(); } }
public GenresController(EntityBoxContext context) { _context = context; if (!_context.Genres.Any()) { _context.Genres.Add(new Genre { Slug = "drama", Title = "Drama", Description = "A drama genre." }); _context.Genres.Add(new Genre { Slug = "fantasy", Title = "Fantasy", Description = "A fantasy genre." }); _context.SaveChanges(); } }