using System.Linq.Expressions;
namespace ExpenseService.Domain.Shared.Interfaces;
/// <summary>
/// Represents a specification that defines a condition that an entity must satisfy.
/// </summary>
/// <typeparam name="T">The type of entity.</typeparam>
public interface ISpecification<T> where T: class
{
bool IsSatisfiedBy(T entity);
Expression<Func<T, bool>> ToExpression();
ISpecification<T> And(ISpecification<T> other);
}
using System.Linq.Expressions;
namespace ExpenseService.Domain.Shared.Interfaces;
/// <summary>
/// Represents a specification that defines a condition that an entity must satisfy.
/// </summary>
/// <typeparam name="T">The type of entity.</typeparam>
public interface ISpecification<T> where T: class
{
bool IsSatisfiedBy(T entity);
Expression<Func<T, bool>> ToExpression();
ISpecification<T> And(ISpecification<T> other);
}