コード例 #1
0
 public SupplierAPIData(Supplier supplier)
 {
     SupplierID = supplier.SupplierID;
     CompanyName = supplier.CompanyName;
     City = supplier.City;
     Country = supplier.Country;
 }
コード例 #2
0
        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();
            }
        }