public ActionResult Create([Bind(Include = "ActivityId,refCategoryId,ActivityName,ActivityDescryption")] Activity activity)
        {
            if (ModelState.IsValid)
            {
                db.Activities.Add(activity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.refCategoryId = new SelectList(db.Categories, "CategoryId", "CategoryName", activity.refCategoryId);
            return(View(activity));
        }
Esempio n. 2
0
 public void Save()
 {
     _context.SaveChanges();
 }