public ActionResult Edit(RiskLevel r, int id) { if (ModelState.IsValid) { db.RiskLevels.Attach(r); db.ObjectStateManager.ChangeObjectState(r, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(r); }
/// <summary> /// Deprecated Method for adding a new object to the RiskLevels EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRiskLevels(RiskLevel riskLevel) { base.AddObject("RiskLevels", riskLevel); }
/// <summary> /// Create a new RiskLevel object. /// </summary> /// <param name="levelId">Initial value of the LevelId property.</param> /// <param name="levelName">Initial value of the LevelName property.</param> /// <param name="minValue">Initial value of the MinValue property.</param> /// <param name="maxValue">Initial value of the MaxValue property.</param> public static RiskLevel CreateRiskLevel(global::System.Int32 levelId, global::System.String levelName, global::System.Int32 minValue, global::System.Int32 maxValue) { RiskLevel riskLevel = new RiskLevel(); riskLevel.LevelId = levelId; riskLevel.LevelName = levelName; riskLevel.MinValue = minValue; riskLevel.MaxValue = maxValue; return riskLevel; }