public async Task <IActionResult> DeleteMatch(int matchId) { var result = await _matchService.DeleteMatchAsync(matchId); if (result.ErrorOccurred) { return(BadRequest(result)); } return(Ok(result)); }
public async Task <IActionResult> Delete([FromRoute] int id) { try { await matchService.DeleteMatchAsync(id); return(Accepted()); } catch (AmbiguousMatchException) { return(StatusCode(431)); } catch (NotFoundInDatabaseException) { return(NotFound()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <IHttpActionResult> Delete(int id) { return(Json(await _matchService.DeleteMatchAsync(id))); }