Linq to SQL - Returning two values with one query

Posted by Sir Psycho on Stack Overflow See other posts from Stack Overflow or by Sir Psycho
Published on 2010-03-26T11:45:19Z Indexed on 2010/03/26 11:53 UTC
Read the original article Hit count: 240

Filed under:
|

Hi,

Is it possible to return a single value and an enumerable collection using LINQ to SQL?

The problem is, I'm trying to do paging across a large recordset. I only want to return 10 rows at a time so I'm using .Skip(20).Take(10) approach.

However I need to know the total number of records so I can show an appropriate page x of y.

Trying to avoid two separate queries.

Thanks

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about c#