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