public CategoriesController(MovieDemoWebApiContext context) { _context = context; if (_context.Categories.Count() == 0) { _context.Categories.Add(new Category { Name = "Animation" }); _context.Categories.Add(new Category { Name = "Comedy" }); _context.Categories.Add(new Category { Name = "Horror" }); _context.Categories.Add(new Category { Name = "Thriller" }); _context.SaveChanges(); } }
public MoviesController(MovieDemoWebApiContext context) { _context = context; }