Browse Source

Close #55: Add ProductDetailHasBeenUsedException

pull/58/head
gdlcf88 6 years ago
parent
commit
e002d7db61
  1. 13
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductDetailHasBeenUsedException.cs
  2. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs

13
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductDetailHasBeenUsedException.cs

@ -0,0 +1,13 @@
using System;
using Volo.Abp;
namespace EasyAbp.EShop.Products.Products
{
public class ProductDetailHasBeenUsedException : BusinessException
{
public ProductDetailHasBeenUsedException(Guid productDetailId) : base(
message: $"ProductDetail {productDetailId} has been used.")
{
}
}
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs

@ -164,7 +164,7 @@ namespace EasyAbp.EShop.Products.Products
if (otherOwner != null)
{
throw new EntityNotFoundException(typeof(ProductDetail), desiredProductDetailId);
throw new ProductDetailHasBeenUsedException(desiredProductDetailId);
}
}

Loading…
Cancel
Save