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