public ActionResult RiskCatNew(RiskCat cat) { if (ModelState.IsValid) { db.RiskCats.AddObject(cat); db.SaveChanges(); return RedirectToAction("RiskCatList"); } return View(cat); }
public ActionResult RiskCatEdit(RiskCat cat) { if (ModelState.IsValid) { db.RiskCats.Attach(cat); db.ObjectStateManager.ChangeObjectState(cat, EntityState.Modified); db.SaveChanges(); return RedirectToAction("RiskCatList"); } return View(cat); }
/// <summary> /// Deprecated Method for adding a new object to the RiskCats EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRiskCats(RiskCat riskCat) { base.AddObject("RiskCats", riskCat); }
/// <summary> /// Create a new RiskCat object. /// </summary> /// <param name="riskCatId">Initial value of the RiskCatId property.</param> /// <param name="riskCatName">Initial value of the RiskCatName property.</param> public static RiskCat CreateRiskCat(global::System.Int32 riskCatId, global::System.String riskCatName) { RiskCat riskCat = new RiskCat(); riskCat.RiskCatId = riskCatId; riskCat.RiskCatName = riskCatName; return riskCat; }