public ActionResult <bool> OpenRoulette([FromBody] OpenRouletteRequest openRoulette) { bool rouletteExist = _rouletteService.ExistRoulette(openRoulette.RoulettetoOpen); if (!rouletteExist) { return(NotFound()); } else { _rouletteService.OpenRoulette(openRoulette); } return(Ok(true)); }
public ActionResult OpenRoulette(int id) { try { bool successTransaction = rouletteService.OpenRoulette(id); if (!successTransaction && !string.IsNullOrEmpty(rouletteService.ErrorMessage)) { return(BadRequest(rouletteService.ErrorMessage)); } return(Ok(successTransaction)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> OpenRoulette(int rouletteId) { try { var result = await _rouletteService.OpenRoulette(rouletteId); if (result == ResponseCode.Ok) { return(Ok(result)); } return(BadRequest(ResponseMessages[ResponseCode.Rejected])); } catch (Exception ex) { return(BadRequest(ResponseMessages[ResponseCode.InternalError])); } }
public HttpResponseMessage OpenRoulette(Roulette roulette) { var response = Request.CreateResponse(HttpStatusCode.NotImplemented); var res = RouletteService.OpenRoulette(roulette.Id); if (res >= 1) { response = Request.CreateResponse(HttpStatusCode.OK); } else { response = Request.CreateResponse(HttpStatusCode.NotModified); } return(response); }
public async Task <IActionResult> OpenRulette(int id) { var roulette = await _rouletteService.OpenRoulette(id); return(Ok(ResponseMapper.MapOp(roulette))); }