You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i don't know if this is intended behavior but when i try to order by a field that has a subquery, EFCore generates a copy of the subquery instead of using the field.
For example i have a "Post" table with "PostLike" table (1..N):
SELECT (
SELECT COUNT(*)
FROM [Social].[PostLike] AS [p1]
WHERE [p].[PostId] = [p1].[PostId]) AS [Likes]
FROM [Social].[Post] AS [p]
ORDER BY (
SELECT COUNT(*)
FROM [Social].[PostLike] AS [p0]
WHERE [p].[PostId] = [p0].[PostId]) DESC
Instead of:
SELECT (
SELECT COUNT(*)
FROM [Social].[PostLike] AS [p1]
WHERE [p].[PostId] = [p1].[PostId]) AS [Likes]
FROM [Social].[Post] AS [p]
ORDER BY Likes DESC
Is there any way to fix this?.
Currently using EFCore 7 preview 1.22076.6 with the same ver for SQL Server provider.
The text was updated successfully, but these errors were encountered:
Hi, i don't know if this is intended behavior but when i try to order by a field that has a subquery, EFCore generates a copy of the subquery instead of using the field.
For example i have a "Post" table with "PostLike" table (1..N):
Gives me the following query:
Instead of:
Is there any way to fix this?.
Currently using EFCore 7 preview 1.22076.6 with the same ver for SQL Server provider.
The text was updated successfully, but these errors were encountered: