I have simple POCO classes:
public class Library
{
[Key]
public string LibraryId { get; set; }
public string Name { get; set; }
public List<Book> Books { get; set; }
}
public class Book
{
[Key]
public string BookId { get; set; }
public string Name { get; set; }
public string Text { get; set; }
}
And I have query, that returns libraries with already included books:
dbContext.Set<Library>.Include(x => x.Books);
I'm trying to skip 5 libraries and then take 10 of them:
await dbContext.Set<Library>.Include(x => x.Books).Skip(5).Take(10).ToListAsync();
The problem is, that when I'm trying to perform Skip
and Take
methods on this query, it returns libraries without included list of books.
How can I work with Skip
and Take
, with saving previously included entities?
Skip
andTake
? Since that is the issue, you should probably include those in the question.UseRowNumberForPaging())
,Skip
doesn't work with this.