public CustomersController(BitCoINCLLCContext context) { _context = context; if (_context.Customers.Count() == 0) { _context.Customers.Add(new Customer() { Id = 1, Name = "Walmart", IsBulk = true }); _context.Customers.Add(new Customer() { Id = 2, Name = "Bob's Liquor", IsBulk = false }); _context.Customers.Add(new Customer() { Id = 3, Name = "SexyFidgetySpinners.com", IsBulk = true }); _context.SaveChanges(); } }
public StoresController(BitCoINCLLCContext context) { _context = context; if (_context.Stores.Count() == 0) { _context.Stores.Add(new Store() { Id = 1, LocationNumber = 432, District = "NorthEast" }); _context.Stores.Add(new Store() { Id = 2, LocationNumber = 244, District = "Southwest" }); _context.Stores.Add(new Store() { Id = 3, LocationNumber = 743, District = "Pacific" }); _context.SaveChanges(); } }
public AdminsController(BitCoINCLLCContext context) { _context = context; if (_context.Admins.Count() == 0) { _context.Admins.Add(new Admin() { Id = 1, Name = "Harrison" }); _context.Admins.Add(new Admin() { Id = 2, Name = "Billy" }); _context.Admins.Add(new Admin() { Id = 3, Name = "Taylor" }); _context.SaveChanges(); } }
public OrdersController(BitCoINCLLCContext context) { _context = context; if (_context.Orders.Count() == 0) { _context.Orders.Add(new Order() { Id = 1, Products = "The Orange Attack, Ocean Blue", InvoiceNumber = 7483928 }); _context.Orders.Add(new Order() { Id = 2, Products = "The Orange Attack, The Gold Rush", InvoiceNumber = 9040932 }); _context.Orders.Add(new Order() { Id = 3, Products = "The Gold Rush, Ocean Blue", InvoiceNumber = 8765490 }); _context.SaveChanges(); } }
public SpinnersController(BitCoINCLLCContext context) { _context = context; if (_context.Spinners.Count() == 0) { _context.Spinners.Add(new Spinner() { Id = 1, Name = "The Orange Attack", Color = "Blood Orange", Price = "$20.99" }); _context.Spinners.Add(new Spinner() { Id = 2, Name = "The Gold Rush", Color = "Gold", Price = "$21.99" }); _context.Spinners.Add(new Spinner() { Id = 3, Name = "Ocean Blue", Color = "Sky Blue", Price = "$15.99" }); _context.SaveChanges(); } }
public Store Post([FromBody] Store s) { _context.Stores.Add(s); _context.SaveChanges(); return(s); }
public Admin Post([FromBody] Admin s) { _context.Admins.Add(s); _context.SaveChanges(); return(s); }
public Customer Post([FromBody] Customer s) { _context.Customers.Add(s); _context.SaveChanges(); return(s); }
public Order Post([FromBody] Order s) { _context.Orders.Add(s); _context.SaveChanges(); return(s); }
public Spinner Post([FromBody] Spinner s) { _context.Spinners.Add(s); _context.SaveChanges(); return(s); }