Beispiel #1
0
        public async Task <ActionResult <BaseResponse <CloseResponse> > > Close(int id)
        {
            BaseResponse <CloseResponse> response = await _rouletteService.Close(id);

            if (!string.IsNullOrEmpty(response.message))
            {
                return(BadRequest(response));
            }
            return(Ok(response));
        }
Beispiel #2
0
 public IActionResult Close([FromRoute(Name = "id")] string id)
 {
     try
     {
         Roulette roulette = rouletteService.Close(id);
         return(Ok(roulette));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(StatusCode(405));
     }
 }
        public async Task <IActionResult> Close([FromBody] string idRoulette)
        {
            try
            {
                IEnumerable <WinnerDto> winners = await _rouletteService.Close(idRoulette);

                return(Ok(winners));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }