我對我的一些查詢有一些性能問題。當我query Sql Server for a list of slow queries,我發現一些由Linq-To-Entities生成的查詢。如何查找出現在Sql Server Sloq查詢日誌中的linq生成的Sql查詢?
例如:
SELECT
[Project12].[OrderId] AS [OrderId],
[Project12].[OrderDate] AS [OrderDate],
[Project12].[OrderStatusId] AS [OrderStatusId],
[Project12].[Name] AS [Name],
[Project12].[C1] AS [C1],
[Project12].[ClientId] AS [ClientId],
[Project12].[ClientCode] AS [ClientCode],
[Project12].[TwoLetterCode] AS [TwoLetterCode],
[Project12].[Identifier] AS [Identifier],
[Project12].[StartDate] AS [StartDate],
[Project12].[Code] AS [Code],
[Project12].[C2] AS [C2],
[Project12].[C3] AS [C3],
[Project12].[C4] AS [C4],
[Project12].[C5] AS [C5]
FROM (SELECT
[Project11].[OrderId] AS [OrderId],
[Project11].[ClientId] AS [ClientId],
[Project11].[StartDate] AS [StartDate],
[Project11].[Identifier] AS [Identifier],
....
我試圖用型動物領域找到我在那裏查詢這些領域,但我找不到在哪裏。
什麼技術可以用來找到哪些Linq查詢生成一些SQL?
您不能在EF中使用DataContext.Log。 – 2013-02-15 18:16:06