public ActionResult Edit(color color) { if (ModelState.IsValid) { db.colors.Attach(color); db.ObjectStateManager.ChangeObjectState(color, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(color); }
public ActionResult Create(color color) { if (ModelState.IsValid) { db.colors.AddObject(color); db.SaveChanges(); return RedirectToAction("Index"); } return View(color); }
/// <summary> /// Create a new color object. /// </summary> /// <param name="id">Initial value of the id property.</param> public static color Createcolor(global::System.Int32 id) { color color = new color(); color.id = id; return color; }
/// <summary> /// Deprecated Method for adding a new object to the colors EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTocolors(color color) { base.AddObject("colors", color); }