28

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?

1 Answer 1

46
EntityQuery<Employee> query = (from e in ctx.GetEmployeeQuery()  
                              orderby e.DateCreated descending
                              select e).Take (100);
Sign up to request clarification or add additional context in comments.

2 Comments

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"...)
For the ultimate cred, the shirt would need to have a linq statement that returns "I love LINQ".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.