Exemplo n.º 1
0
        public ActionResult Create([Bind(Include = "CategoryId,CategoryTitle,UserId")] Category category)
        {
            if (ModelState.IsValid)
            {
                db.Category.Add(category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(category));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "Id,Email,Password")] AppUser appUser)
        {
            if (ModelState.IsValid)
            {
                db.AppUser.Add(appUser);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(appUser));
        }
Exemplo n.º 3
0
 public void AddTask(UserTask userTask)
 {
     db.UserTask.Add(userTask);
     db.SaveChanges();
 }
Exemplo n.º 4
0
 public void AddCategory(Category category)
 {
     db.Category.Add(category);
     db.SaveChanges();
 }