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(); } }
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(); } }