Ejemplo n.º 1
0
 public void Categories_Update(Category item)
 {
     using (ToolsContext context = new ToolsContext())
     {
         #region Student Code here
         //insert udpate code
         var updating = context.Categories.Attach(item);
         var matchingWithExistingValues = context.Entry<Category>(updating);
         matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
         #endregion
     }
 }