public ActionResult Add(TodoModel todoModel)
 {
     if (!string.IsNullOrWhiteSpace(todoModel.NewTitle))
     {
         StateContext.Bag.id = null;
         var todo = new Todo {
             Id = Id++,
             Title = todoModel.NewTitle.Trim()
         };
         Todos.Add(todo);
         HttpContext.Items["todoId"] = todo.Id;
     }
     return View();
 }
 public ActionResult _Content(string mode)
 {
     var model = new TodoModel { Todos = Todos };
     model.ItemsLeft = model.Todos.Count(t => !t.Completed);
     model.CompletedCount = model.Todos.Count(t => t.Completed);
     if (mode != "all")
         model.Todos = model.Todos.Where(t => t.Completed == (mode == "completed"));
     return View(model);
 }