public sealed class GetJobContactsSpecification : Specification<Job, List<Contact>>
{
public GetJobContactsSpecification(Guid jobId, string userId)
{
Query
.Select(x => x.Contacts.ToList())
.Include(x => x.Contacts)
.ThenInclude(x => x.Companies)
.Include(x => x.Contacts)
.ThenInclude(x => x.Phones)
.Include(x => x.Contacts)
.ThenInclude(x => x.Emails)
.AsSplitQuery()
.AsNoTracking()
.Where(x => x.Id == jobId && x.OwnerId == userId);
}
}
public sealed class GetJobContactsSpecification : Specification<Job, List<Contact>>
{
public GetJobContactsSpecification(Guid jobId, string userId)
{
Query
.Select(x => x.Contacts.ToList())
.Include(x => x.Contacts)
.ThenInclude(x => x.Companies)
.Include(x => x.Contacts)
.ThenInclude(x => x.Phones)
.Include(x => x.Contacts)
.ThenInclude(x => x.Emails)
.AsSplitQuery()
.AsNoTracking()
.Where(x => x.Id == jobId && x.OwnerId == userId);
}
}