move GuardExtensions (#595)

This commit is contained in:
Steve Smith
2021-10-26 12:38:35 -04:00
committed by GitHub
parent c23d92793e
commit c7e171e03f

View File

@@ -1,22 +0,0 @@
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
using Microsoft.eShopWeb.ApplicationCore.Exceptions;
using System.Collections.Generic;
using System.Linq;
namespace Ardalis.GuardClauses
{
public static class BasketGuards
{
public static void NullBasket(this IGuardClause guardClause, int basketId, Basket basket)
{
if (basket == null)
throw new BasketNotFoundException(basketId);
}
public static void EmptyBasketOnCheckout(this IGuardClause guardClause, IReadOnlyCollection<BasketItem> basketItems)
{
if (!basketItems.Any())
throw new EmptyBasketOnCheckoutException();
}
}
}