public async Task <IActionResult> DeleteMatch(int matchId)
        {
            var result = await _matchService.DeleteMatchAsync(matchId);

            if (result.ErrorOccurred)
            {
                return(BadRequest(result));
            }

            return(Ok(result));
        }
Esempio n. 2
0
        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));
            }
        }
Esempio n. 3
0
 public async Task <IHttpActionResult> Delete(int id)
 {
     return(Json(await _matchService.DeleteMatchAsync(id)));
 }