tags:

views:

898

answers:

1

WIth Ria Service, I have a linq query like:

EntityQuery<Employee> query = from e in ctx.GetEmployeeQuery()  
                orderby e.DateCreated descending
                              select e;

Then I want to get the top 100 records from this query, like SQL select top 100 * from Employee

How to write the linq query?

+10  A: 
EntityQuery<Employee> query = (from e in ctx.GetEmployeeQuery()  
                              orderby e.DateCreated descending
                              select e).Take (100);
Developer Art
Lol. It seemed such a complex question but again, Linq makes it real simple. (I need to make a t-shirt with "I heart Linq"...)
Workshop Alex