Sql 在EF中,您必须为EF编写自己的数据库提供程序,以便生成更好的查询。 SELECT [Extent1].[Id] AS [Id], N'ODATAModel.LatestFiguresView' AS [C1], N'EntityType,Name,
在EF中,您必须为EF编写自己的数据库提供程序,以便生成更好的查询。Sql 在EF中,您必须为EF编写自己的数据库提供程序,以便生成更好的查询。 SELECT [Extent1].[Id] AS [Id], N'ODATAModel.LatestFiguresView' AS [C1], N'EntityType,Name,,sql,entity-framework,Sql,Entity Framework,在EF中,您必须为EF编写自己的数据库提供程序,以便生成更好的查询。 SELECT [Extent1].[Id] AS [Id], N'ODATAModel.LatestFiguresView' AS [C1], N'EntityType,Name,RegistrationNumber,OfficeNumber,DateRegistered,...,Id' AS [C2], [Extent1].[EntityType] AS [EntityType], [Extent1].[Name]
SELECT
[Extent1].[Id] AS [Id],
N'ODATAModel.LatestFiguresView' AS [C1],
N'EntityType,Name,RegistrationNumber,OfficeNumber,DateRegistered,...,Id' AS [C2],
[Extent1].[EntityType] AS [EntityType],
[Extent1].[Name] AS [Name],
[Extent1].[RegistrationNumber] AS [RegistrationNumber],
[Extent1].[OfficeNumber] AS [OfficeNumber],
... Loads of other columns ...
,
N'' AS [C12]
FROM (SELECT
[LatestFiguresView].[Id] AS [Id],
[LatestFiguresView].[EntityType] AS [EntityType],
[LatestFiguresView].[Name] AS [Name],
[LatestFiguresView].[RegistrationNumber] AS [RegistrationNumber],
[LatestFiguresView].[OfficeNumber] AS [OfficeNumber],
... Loads of those same columns ...
FROM [dbo].[LatestFiguresView] AS [LatestFiguresView]) AS [Extent1]
WHERE (N'Registered' = [Extent1].[RegistrationStatus])
AND ((1 = [Extent1].[Reservation])
OR (1 = (CASE WHEN ([Extent1].[Name] LIKE N'%White%')
THEN cast(1 as bit)
WHEN ( NOT ([Extent1].[Name] LIKE N'%White%'))
THEN cast(0 as bit) END))
OR (1 = (CASE WHEN ([Extent1].[Sectors] LIKE '%Business%')
THEN cast(1 as bit)
WHEN ( NOT ([Extent1].[Sectors] LIKE '%Business%'))
THEN cast(0 as bit) END))
OR ((1 = (CASE WHEN ... etc, etc ... END))))