Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            if (id < 0)
            {
                return(BadRequest("Id must be greater than 0"));
            }

            string email  = Helper.GetEmail(HttpContext);
            var    result = await _repo.DeleteTodo(id, email);

            if (result.res)
            {
                return(Ok("Todo is deleted succesfully"));
            }
            else if (!result.res && result.code == 0)
            {
                return(NotFound());
            }
            else
            {
                return(StatusCode(500));
            }
        }
 public ActionResult DeleteTodo(string Id)
 {
     _repository.DeleteTodo(Id);
     return(NoContent());
 }