示例#1
0
        /// <summary>
        /// This method returns player wallet and locks the record with UPD (update) lock for the scope of the transaction
        /// </summary>
        /// <param name="playerId"></param>
        /// <returns></returns>
        public async Task <Core.Game.Entities.Wallet> GetWalletWithUPDLockAsync(Guid playerId)
        {
            LockWallet(playerId);
            var wallet = await Wallets
                         .Include(w => w.Brand)
                         .SingleOrDefaultAsync(x => x.PlayerId == playerId);

            if (wallet == null)
            {
                throw new RegoException("Wallet does not exist.");
            }

            return(new Core.Game.Entities.Wallet(wallet));
        }
示例#2
0
        public Entities.Wallet GetWalletWithUPDLock(Guid playerId)
        {
            LockWallet(playerId);
            var wallet = Wallets
                         .Include(w => w.Brand)
                         .SingleOrDefault(x => x.PlayerId == playerId);

            if (wallet == null)
            {
                throw new Exception("Wallet does not exist.");
            }

            return(new Entities.Wallet(wallet));
        }