Specification
The specification pattern implementation in RCommon.
public class AllocationExistsSpec : Specification<LeaveAllocation>
{
public AllocationExistsSpec(string userId, int leaveTypeId, int period) :
base(q => q.EmployeeId == userId
&& q.LeaveTypeId == leaveTypeId
&& q.Period == period)
{
}
}var allocationCount = await _leaveAllocationRepository
.GetCountAsync(new AllocationExistsSpec(emp.Id, leaveType.Id, period));Last updated