TAKE is the LINQish equivalent of top. But, it doesn’t exist in the query expression; it’s an extension method.
I’m just tacking it on to the end of the query, at least for now.
I added a RECENT REVIEWS page to the DvdFriend test site. The NOODB query is:
from r in MovieReview take 20
Of course, there should be a SELECT in there, but I’ve been avoiding that.
The next thing I need is to “order by ReviewDate descending”. I haven’t done that yet, but did manually tack it onto the end of the SQL query just to see it work. It worked fine once I addressed the order issues covered in the previous post.
I looked at the linq syntax for order by. When you do it via code, the first sort field is an OrderBy, and all subsequent sort fields are specified by ThenBy. But, looking at the query expresions, I only see ORDER BY. Apparently, it does the THEN by automatically. I’ll find out soon enough.