public IActionResult Delete(string exampleId) { if (!exampleRepository.ExampleExists(exampleId)) { return(NotFound()); } Example example = exampleRepository.GetExample(exampleId); if (!exampleRepository.Delete(example)) { ModelState.AddModelError("", "Delete Error"); return(StatusCode(500)); } return(Ok("Delete Success")); }