public List <Customers> GetAll() { using (NorthwindModel northwind = new NorthwindModel()) { return(northwind.Customers.ToList()); } }
public List <Products> GetAll() { using (NorthwindModel northwind = new NorthwindModel()) { return(northwind.Products.ToList()); } }
public Shippers GetOne(int id) { using (NorthwindModel northwind = new NorthwindModel()) { return(northwind.Shippers.FirstOrDefault(s => s.ShipperID == id)); } }
public List <Categories> GetAll() { using (NorthwindModel northwind = new NorthwindModel()) { return(northwind.Categories.ToList()); } }
public Categories GetOne(int id) { using (NorthwindModel northwind = new NorthwindModel()) { return(northwind.Categories.FirstOrDefault(s => s.CategoryID == id)); } }
public void AddShipper(Shippers shipper) { using (NorthwindModel northwind = new NorthwindModel()) { northwind.Shippers.Add(shipper); northwind.SaveChanges(); } }
public List <Shippers> GetShippers() { using (NorthwindModel northwind = new NorthwindModel()) { List <Shippers> listShippers = northwind.Shippers.ToList(); return(listShippers); } }
public void AddCategorie(Categories shipper) { using (NorthwindModel northwind = new NorthwindModel()) { northwind.Categories.Add(shipper); northwind.SaveChanges(); } }
public List <Categories> GetCategories() { using (NorthwindModel northwind = new NorthwindModel()) { List <Categories> listCategories = northwind.Categories.ToList(); return(listCategories); } }
public void DeleteShipper(int id) { using (NorthwindModel northwind = new NorthwindModel()) { Shippers shipDelete = northwind.Shippers.FirstOrDefault(s => s.ShipperID == id); northwind.Shippers.Remove(shipDelete); northwind.SaveChanges(); } }
public void DeleteCategorie(int id) { using (NorthwindModel northwind = new NorthwindModel()) { Categories shipDelete = northwind.Categories.FirstOrDefault(s => s.CategoryID == id); northwind.Categories.Remove(shipDelete); northwind.SaveChanges(); } }
public void EditarCategorie(Categories categ) { using (NorthwindModel northwind = new NorthwindModel()) { DeleteCategorie(categ.CategoryID); AddCategorie(categ); northwind.SaveChanges(); } }
public void EditarShipper(Shippers shipper) { using (NorthwindModel northwind = new NorthwindModel()) { Shippers shipDelete = northwind.Shippers.FirstOrDefault(s => s.ShipperID == shipper.ShipperID); northwind.Shippers.Remove(shipDelete); northwind.Shippers.Add(shipper); northwind.SaveChanges(); } }