Example #1
0
 public ActionResult <Todo> editTodos(string todoId, Todo editTodos)
 {
     try
     {
         editTodos.todoId = todoId;
         return(Ok(_service.Edit(editTodos)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <Todo> EditTodo([FromBody] Todo updated, int id)
 {
     try
     {
         updated.Id = id;
         return(Ok(_service.Edit(updated)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Example #3
0
        public async Task <ActionResult <Todo> > Edit(int id, [FromBody] Todo todo)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                todo.CreatorId = userInfo.Id;
                todo.Id        = id;
                return(Ok(_tdService.Edit(todo)));
            }
            catch (System.Exception err)
            {
                return(BadRequest(err.Message));
            }
        }