Entity MVC adding a new row and grabbing the id used
I have a method that adds a new row for a table. What I need to do is grab
that ID it used for that row and put it into my sortOrder row as well.
[HttpPost]
public ActionResult AddProcedure(Procedures procedure,
FormCollection collection)
{
procedure.processID =
Convert.ToInt32(collection["DropDownList.SelectedIndexId"]);
// ADD Default KPI
db.Procedure.Add(procedure);
db.SaveChanges();
return RedirectToAction("AddProcedure", "MasterList");
}
How would I grab the ID and add it to procedures.sortOrder
No comments:
Post a Comment