Код: Выделить всё
select * from [dbo].[LitEdit] as le
inner join [dbo].[LitEditJob] as lej
on lej.BulkEditId = le.Id
inner join [dbo].[LitEditJobTask] as job
on job.litEditJobId = lej.Id
where lej.LitProcessId = 'ABC002512'
and job.State = 'init'
order by job.LitNumber
OFFSET 10 ROWS
FETCH NEXT 10 ROWS ONLY
Код: Выделить всё
var retval = await context.LitEditJob
.Include(j => j.litEdit)
.ThenInclude(b => b.LitEditJobs)
.ThenInclude(jb => jb.LitEditJobTasks)
.Where(j => j.LitProcessId == "ABC002512")
.FirstOrDefaultAsync(cancellationToken);
Код: Выделить всё
var jobs = await context.LitEditJob
.Include(j => j.LitEdit)
.ThenInclude(b => b.LitEditJobs)
.Where(j => j.LitProcessId == "ABC002512")
.SelectMany(j => j.LitEditJobTasks)
.OrderBy(t => t.LitNumber)
.Skip(10)
.Take(10)
.ToListAsync(cancellationToken);
Подробнее здесь: https://stackoverflow.com/questions/798 ... ptimized-w
Мобильная версия