public ActionResult DeletePlayer(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PlayersBm blogArticleBm = service.DeletePlayer(id); if (blogArticleBm == null) { return(HttpNotFound()); } return(View(blogArticleBm)); }
public async Task <IActionResult> Delete(int id) { if (id <= 0) { return(BadRequest("Not a valid player id")); } var player = await _playersService.GetPlayerById(id); if (player == null) { return(NotFound()); } await _playersService.DeletePlayer(player); return(NoContent()); }