public ActionResult Delete(int id, FormCollection collection) { // TODO: Add delete logic here AppContext context = new AppContext(); MemberActivity model = context.MemberActivities.Find(id); context.MemberActivities.Remove(model); context.SaveChanges(); return(RedirectToAction("About")); }
public ActionResult Create(FormCollection collection) { // TODO: Add insert logic here AppContext context = new AppContext(); MemberActivity model = context.MemberActivities.Add(new MemberActivity() { Member = collection.Get("Member"), Activity = collection.Get("Activity") }); context.SaveChanges(); return(RedirectToAction("About")); }