Пример #1
0
        public ActionResult Edit(int id)
        {
            var result = _toDoListService.Get(id);

            if (result.HasError)
            {
                return(RedirectToAction("List"));
            }

            return(View(result.Data));
        }
Пример #2
0
        public IActionResult Get([FromQuery] ToDoListModel model = null)
        {
            if (model == null)
            {
                model = new ToDoListModel();
            }
            var results = _logic.Get(model);

            return(this.Ok(results));
        }
Пример #3
0
        protected void rptToDoList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Delete")
            {
                var toDoList = _toDoListService.Get(id);
                _toDoListService.Delete(toDoList);
            }
            LoadToDoList();
        }
Пример #4
0
 public Task <IEnumerable <ToDoListVM> > Get()
 {
     return(_todolistService.Get());
     //return new string[] { "value1", "value2" };
 }
 //[Route("GetId")]
 public async Task <IEnumerable <ToDoList> > Get(int id)
 {
     return(await _toDoListService.Get(id));
 }