private async Task IncrementJackpotAsync() { var bet = await _dbHelper.GetUnProcessedBetAsync(); //Fetch the bet of which amount didn't affect a jackpot if (bet == null) { return; } var jackPot = await _dbHelper.GetJackpotAsync(); var jackPotNewAmount = (jackPot?.Amount ?? 0) + bet.Amount / 100; //Calculate jackpot amount await _dbHelper.AddJackPotAsync(new Jackpot //I am using append-only approach to have track of changes and full history of jackpot entity { SpinId = bet.SpinId, Amount = jackPotNewAmount, DateCreated = DateTime.Now }); bet.Processed = true; await _dbHelper.UpdateBet(bet); _logger.LogInformation($"Jackpot new amount is {jackPotNewAmount}"); //Push notifications to all connected clients }