public StudentController(WebModelContext context)
 {
     _context = context;
     if (!_context.Products.Any())
     {
         _context.Products.Add(new Product()
         {
             Name       = "Bánh mỳ",
             CategoryId = 1,
             Images     = "http://www.puratosgrandplace.com/Data/Sites/1/media/news/ba%CC%81nh-mi%CC%80-5.jpg",
             Status     = 1
         });
         _context.SaveChanges();
     }
 }
Exemple #2
0
 public StudentController(WebModelContext context)
 {
     _context = context;
 }