public ActionResult Create(Selection model, FormCollection collection) { try { if (ModelState.IsValid) { Repository.Add(model); Repository.Save(); return RedirectToAction("Index", new { id = model.FieldId }); } return View(model); } catch { Selection model2 = new Selection(); model2.FieldId = model.FieldId; return View(model2); } }
public void Delete(Selection item) { db.Selections.Remove(item); }
// // GET: /Selections/Create public ActionResult Create(int id) { Selection model = new Selection(); model.FieldId = id; return View(model); }
// // Insert/Delete Methods public void Add(Selection item) { db.Selections.Add(item); }