private void OnProductListRemove(Product entity)
 {
     SendPropertyChanging(null);
     entity.Category = null;
     SendPropertyChanged(null);
 }
Ejemplo n.º 2
0
        public void CreateProduct()
        {
            Stopwatch watch = Stopwatch.StartNew();

            var product = new Product();
            product.ProductId = ID;
            product.CategoryId = ID;
            product.Image = "/.png";
            product.Descn = "";
            product.Name = "";

            try
            {
                using (var context = new PetShopDataContext())
                {
                    context.Product.InsertOnSubmit(product);
                    context.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            Assert.IsTrue(true);

            Console.WriteLine("Time: {0} ms", watch.ElapsedMilliseconds);
        }
 private void OnProductListAdd(Product entity)
 {
     SendPropertyChanging(null);
     entity.Category = this;
     SendPropertyChanged(null);
 }
 partial void OnProductChanging(Product value);