Example #1
0
        public async Task <IActionResult> NewRoulette(Roulette rouletteNew)
        {
            rouletteNew.NameRoulette = rouletteNew.NameRoulette.ToLower();
            if (await _repo.RouletteExists(rouletteNew.NameRoulette))
            {
                return(BadRequest("La ruleta ya existe"));
            }
            var RouletteToCreate = new Roulette
            {
                NameRoulette = rouletteNew.NameRoulette,
                State        = rouletteNew.State
            };
            var createdRoulette = await _repo.RegisterRoulette(RouletteToCreate);

            return(Ok(createdRoulette.Id));
        }