Esempio n. 1
0
        public ActionResult <List <decimal> > Take(int id)
        {
            try
            {
                return(_productsService.Take(id));
            }
            catch (ProductNotAllowedException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (NoChangeException ex)
            {
                _userWalletService.GetCoins().ForEach(coin => _machineWalletService.RemoveCoin(coin));
                _userWalletService.RemoveAllCoins();

                return(BadRequest(ex.Message));
            }
        }
 public ActionResult <decimal> Delete()
 {
     return(_userWalletService.RemoveAllCoins());
 }