예제 #1
0
        public ProductsController(FabrikaContext context)
        {
            _context = context;

            if (_context.Products.Count() == 0)
            {
                _context.Products.Add(new Product {
                    Id = 19201, Name = "Lego Nexo Knights King I", UnitPrice = 45
                });
                _context.Products.Add(new Product {
                    Id = 23942, Name = "Lego Starwars Minifigure Jedi", UnitPrice = 55
                });
                _context.Products.Add(new Product {
                    Id = 30021, Name = "Star Wars çay takýmý ", UnitPrice = 35.50
                });
                _context.Products.Add(new Product {
                    Id = 30492, Name = "Star Wars kahve takýmý", UnitPrice = 24.40
                });

                _context.SaveChanges();
            }
        }
 public FabrikaController(FabrikaContext context)
 {
     Context = context;
 }