-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_BaseSpecification_T_.cs
More file actions
23 lines (16 loc) · 1.07 KB
/
_BaseSpecification_T_.cs
File metadata and controls
23 lines (16 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using SpecificationPattern.Application.Interfaces;
using SpecificationPattern.Domain.Entities;
using System.Linq.Expressions;
namespace SpecificationPattern.Domain.Specifications
{
public abstract class BaseSpecification<T> : BaseSpecification<T,T>, ISpecification<T> where T : BaseEntity { }
public abstract class BaseSpecification<TEntity, TProjection> : ISpecification<TEntity, TProjection> where TEntity : BaseEntity
{
public IList<Expression<Func<TEntity, bool>>> WhereExpressions { get; protected set; } = new List<Expression<Func<TEntity, bool>>>();
public IList<Expression<Func<TEntity, object>>> IncludeExpressions { get; protected set; } = new List<Expression<Func<TEntity, object>>>();
public IList<Expression<Func<TProjection, object>>> OrderByExpressions { get; protected set; } = new List<Expression<Func<TProjection, object>>>();
public ushort? Take { get; protected set; }
public uint? Skip { get; protected set; }
public Expression<Func<TEntity, TProjection>>? SelectExpression { get; protected set; }
}
}