public void Update(Category category) { Category dest = WebSiteDB.MyNorthwind.Categories.FirstOrDefault( c => c.CategoryID == category.CategoryID); if( dest != null ) dest.CategoryName = category.CategoryName; }
public void Update(Category category) { category.EnsureItemIsOK(); BllFactory.GetCategoryBLL().Update(category); }
public void Insert(Category category) { category.EnsureItemIsOK(); BllFactory.GetCategoryBLL().Insert(category); }
public void Insert(Category category) { int maxId = WebSiteDB.MyNorthwind.Categories.Max(x => x.CategoryID); category.CategoryID = maxId + 1; WebSiteDB.MyNorthwind.Categories.Add(category); }