コード例 #1
0
 public PurchaseEntity GetPurchase(int id)
 {
     try
     {
         return(purchaseService.GetById(id).ToBalPurchase(productService));
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new PurchaseNotFoundException("No purchase was found");
     }
 }
コード例 #2
0
 /// <summary>
 /// find product by id
 /// </summary>
 /// <param name="id">id of expected product</param>
 /// <returns>product</returns>
 public ProductEntity GetProduct(int id)
 {
     try
     {
         return(productService.GetById(id).ToBalProduct());
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new ProductNotFoundException("No product was found");
     }
 }