Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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"));
        }