public async Task <double> Add(Demonination denomination)
 {
     return(await Task.Run(() =>
     {
         machineBalances[denomination] = machineBalances[denomination] + 1;
         return machineBalances.GetBalanceSum();
     }));
 }
Exemplo n.º 2
0
        public async Task <double> Add(Demonination denomination)
        {
            return(await Task.Run(() =>
            {
                if (cashBalances.ContainsKey(denomination))
                {
                    cashBalances[denomination] = cashBalances[denomination] + 1;
                }
                else
                {
                    cashBalances.Add(denomination, 1);
                }

                return cashBalances.GetBalanceSum();
            }));
        }