Exemple #1
0
 public OrderResultViewModel Order(Order t)
 {
     try
     {
         var change = _vendingMachine.Purchased(t.ProductId, t.PaidBalance);
         var result = new OrderResultViewModel {
             ProductId = t.ProductId, ChangeValue = change.Value, OrderId = t.OrderId
         };
         if (change.Value >= 0.05m)
         {
             result.ChangeSetup = change.ToString();
         }
         return(result);
     }
     catch (KeyNotFoundException)
     {
         throw;
     }
 }