ObjectQuery.ToTraceString 方法 ()
用法
int productID = 900; using (AdventureWorksEntities context = new AdventureWorksEntities()) { // Define the object query for the specific product. ObjectQuery<Product> productQuery = context.Products.Where("it.ProductID = @productID"); productQuery.Parameters.Add(new ObjectParameter("productID", productID)); // Write the store commands for the query. Console.WriteLine(productQuery.ToTraceString()); }来自msdn