productQuery1.SelectValue<Int32>("it.ProductID");
我怎么知道“它”在这里意味着什么?
的整个示例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);
}
}
答案 0 :(得分:9)
更像this
。
It's a convention in query builder methods
在查询构建器方法中,您可以使用别名来引用当前的ObjectQuery命令。默认情况下,字符串“it”是表示当前命令的别名...