This question is locked. New answers and comments are not allowed.
Hi
I am using the latest version of OpenAccess and when running the following LINQ query...
...I get the following SQL statements reported in the SQL Profiler...
When I run the same query using the Entity Framework I get...
Can anyone tell me why I get two different SQL statements?
Thanks
Michael
I am using the latest version of OpenAccess and when running the following LINQ query...
( from user in domainModel.Users join company in domainModel.Companies on user.Id equals company.UserId where user.UserName == userName select company ).FirstOrDefault()...I get the following SQL statements reported in the SQL Profiler...
SELECT TOP(@__TAKE) b.[Id] AS COL1 FROM [User] a JOIN [Company] AS b ON (a.[Id] = b.[UserId]) WHERE a.[UserName] = 'aperson@example.com'SELECT [Name] AS COL1, [Synopsis] AS COL2, [UserId] AS COL3, [UserId] AS COL4, [WebsiteUrl] AS COL5 FROM [Company] WHERE [Id] = @p0When I run the same query using the Entity Framework I get...
SELECT TOP (1) [Extent2].[Id] AS [Id], [Extent2].[UserId] AS [UserId], [Extent2].[Name] AS [Name], [Extent2].[Synopsis] AS [Synopsis], [Extent2].[WebsiteUrl] AS [WebsiteUrl]FROM [dbo].[User] AS [Extent1]INNER JOIN [dbo].[Company] AS [Extent2] ON [Extent1].[Id] = [Extent2].[UserId]WHERE N'aperson@example.com' = [Extent1].[UserName]Can anyone tell me why I get two different SQL statements?
Thanks
Michael