public IActionResult Delete([FromBody] TodoViewModel model) { if (!ModelState.IsValid) { return(BadRequest()); } var todoViewModel = _todoAppService.Delete(model); return(Ok(todoViewModel)); }
public Results.GenericResult Delete(int id) { var result = new Results.GenericResult(); try { result.Success = appService.Delete(id); if (!result.Success) { throw new Exception($"Todo {id} can't be deleted"); } } catch (Exception ex) { result.Errors = new string[] { ex.Message }; } return(result); }
public bool Delete(int id) { return(appService.Delete(id)); }