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