public async Task <OpenRouletteResult> OpenRoulette(Guid rouletteId)
        {
            var current = await _rouletteRepository.GetRoulette(new Roulette { Id = rouletteId });

            current.Open   = true;
            current.Status = StatusType.Active;
            current        = await _rouletteRepository.UpdateRoulette(current);

            var result = new OpenRouletteResult();

            result.Data    = true;
            result.Success = true;
            return(result);
        }
예제 #2
0
 private async Task <Roulette> RunRoulette(Roulette roulette)
 {
     roulette.WinnerNumber = new Random().Next(0, 36);
     roulette.Color        = (ColorType) new Random().Next(1, 2);
     return(await _rouletteRepository.UpdateRoulette(roulette));
 }
예제 #3
0
        public async Task UpdateUserRoulette(User user, Roulette roulette)
        {
            await _userRepository.UpdateUser(user);

            await _rouletteRepository.UpdateRoulette(roulette);
        }