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<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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With