public ActionResult AddTask(jTask task) { var repo = Session["Tasks"] as TaskRepository; repo.AddTask(task); Session["Tasks"] = repo; if (Request.IsAjaxRequest()) { return Json(task); } return RedirectToAction("Index"); }
public void AddTask(jTask task) { task.Id = _id; _id++; Tasks.Add(task); }