-1

I want to get data with using the Entity Framework. For example, the first 100 data then the second 100 data. How can I do that?

gkursad
  • 3
  • 1
  • 2
  • 1
    Welcome to stack overflow. To improve your chances of getting help, please read the [guidance on how to ask a good question](https://stackoverflow.com/help/how-to-ask). As for your question, what have you tried? Have you looked at the LINQ `Skip` and `Take` operators? – jeroenh Aug 14 '18 at 11:40
  • 2
    The search term you are looking for is *paging* – Crowcoder Aug 14 '18 at 11:47

1 Answers1

0

You can try this :

   using(yourDbContext dc = new yourDbContext)
   {
     var list = ( from ro in dc.yourTable orderby ro.order select ro).Take(100);
     //Or var list = ( from ro in dc.yourTable orderby ro.order select ro).Skip(100).Take(100);
   }
Coskun Ozogul
  • 2,389
  • 1
  • 20
  • 32