public SupplierAPIData(Supplier supplier) { SupplierID = supplier.SupplierID; CompanyName = supplier.CompanyName; City = supplier.City; Country = supplier.Country; }
public static void DeleteSupplierProducts(Supplier supplier, NorthwindDbContext db, bool doCommit = true) { ICollection<Product> products = supplier.Products; if (products != null || products.Count() > 0 ) { DeleteProductsOrderDetails(products, db, false); db.Products.RemoveRange(products); } if (doCommit) { db.SaveChanges(); } }