public IActionResult Delete(long id) { if (!authorService.CanBeDeleted(id)) { return(BadRequestWithErrors("The author can't be deleted, because it has some books.")); } authorService.DeleteAuthor(id); return(Ok()); }