public async Task <IHttpActionResult> Delete(int id) { return(await TryCatchAsync(async() => { await _playersServices.Delete(id); return Ok(); })); }
public async Task <IActionResult> Delete(int id) { var userId = GetUserId(); var result = await _service.Delete(id, userId); if (!result) { return(NotFound("No player found")); } return(Ok()); }
public ActionResult DeleteConfirmed(int?id) { service.Delete(id); return(RedirectToAction("AllPlayers")); }