2025-02-06 12:32:28 +05:00
|
|
|
|
using Ardalis.Specification;
|
|
|
|
|
using DD.Persistence.Database.Postgres.Extensions;
|
|
|
|
|
|
2025-02-10 09:27:13 +05:00
|
|
|
|
namespace DD.Persistence.Database.Specifications.Operation;
|
2025-02-10 17:25:45 +05:00
|
|
|
|
public class OrSpec<TEntity> : Specification<TEntity>
|
2025-02-06 12:32:28 +05:00
|
|
|
|
{
|
2025-02-10 17:25:45 +05:00
|
|
|
|
public OrSpec(ISpecification<TEntity> first, ISpecification<TEntity> second)
|
2025-02-06 12:32:28 +05:00
|
|
|
|
{
|
|
|
|
|
var orExpression = first.Or(second);
|
2025-02-10 09:27:13 +05:00
|
|
|
|
if (orExpression == null)
|
2025-02-06 12:32:28 +05:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Query.Where(orExpression);
|
|
|
|
|
}
|
|
|
|
|
}
|