Hi i need suggestion to do this in linq. need to select all rows which are IsAvail = true and get 5 first rows. i done the following query
from i in entity.Bills.OrderBy(e => e.From).Skip(CurrentPage).Take(intRecordsPerPage)
join c in entity.Cust on i.Id equals c.Id into c_join
from c in c_join.DefaultIfEmpty()
where i.IsAvail == true
select new { i, Id = c.Id };
But when the IsAvail is true in 6th recored i cant get it in first page.
i can get in second page only, first page remains blank.
how can i solve this
Simply put the Skip/Take at the end of the query:
(I’ve also put the
whereclause earlier and used query expressions for the whole thing, just for tidiness.)