Esempio n. 1
0
 private static void UpdateProductCategory()
 {
     using (var context = new AWEntities())
     {
         var category = context.ProductCategories.Where(c => c.Name == "New Category").FirstOrDefault();
         category.Name = "Updated Category";
         context.SaveChanges();
     }
 }
Esempio n. 2
0
        private static void InsertNewProductCategory()
        {
            using (var context = new AWEntities())
            {
                var newProductCategory = new ProductCategory
                {
                    Name         = "New Category",
                    rowguid      = Guid.NewGuid(),
                    ModifiedDate = DateTime.Now
                };

                context.ProductCategories.Add(newProductCategory);
                context.SaveChanges();
            }
        }