-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity Framework Core, computed column does not appear in WHERE clause #9979
Comments
Does it work if you remove cast to |
It works fine with EF Core 2.0.0 |
@MichaelGiger - Thanks for confirmation. In 1.x releases, |
Duplicate of #6937 |
Hi
I have generated the entity model from an existing database (Scaffold-DbContext).
The table [CfgData] has following computed column [LoggerId]:
((CONVERT([bigint],[configurationID],(0))+(10000000)*CONVERT([bigint],[stationID],(0)))+(1000000000)*CONVERT([bigint],[loggerPrefix],(0)))
I had performance problem when I ran the following query:
In the SQL Server Profiler, I've seen that the LoggerIDs are not included in the WHERE clause!
This is the SQL command that the Entity Framework is running:
SELECT [w].[configurationID], [w].[stationID], ....
FROM [dbo].[CFGData] AS [w]
WHERE [w].[status] = 1
Is this a known issue?
Further technical details
EF Core version: 1.1.2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Win 10
IDE: Visual Studio 2017, 15.3.0
The text was updated successfully, but these errors were encountered: