productQuery1.SelectValue<Int32>("it.ProductID");
How would I know what "it" means here?
Whole example from MSDN docs
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
string queryString =
@"SELECT VALUE product FROM
AdventureWorksEntities.Products AS product";
ObjectQuery<Product> productQuery1 =
new ObjectQuery&l开发者_如何学Got;Product>(queryString,
context, MergeOption.NoTracking);
ObjectQuery<Int32> productQuery2 =
productQuery1.SelectValue<Int32>("it.ProductID");
foreach (Int32 result in productQuery2)
{
Console.WriteLine("{0}", result);
}
}
It's more like this
.
It's a convention in query builder methods.
In a query builder method, you refer to the current ObjectQuery command by using an alias. By default, the string "it" is the alias that represents the current command...
精彩评论