Hi Rachel,
Take a look (back) at chapter 13 - LINQ, with page 433 in particular. It shows the following LINQ query:
var allReviews = from r in myDataContext.Reviews
select r;
Right below it, r is explained and referred to as a "range variable" which is available within the context of the query. It's used to refer to an item in the collection in the relevant parts of the query (in the select clause to select it, in the where clause to filter it and so on).
So, yes, it is indeed a variable name. You can make up anything you want as long it's a valid C# variable name. That rules out pure number though.
I typically use a single letter from the strongly typed items I am querying. So, I'd use a b for Books, an r for Reviews and so on. However, if you want you can be more expressive:
var allReviews = from review in myDataContext.Reviews
select review;
Hope this helps,
Imar
|