Skip to content
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

Missing column from Sql Generated #12934

Closed
Manmeetsm opened this issue Aug 8, 2018 · 1 comment
Closed

Missing column from Sql Generated #12934

Manmeetsm opened this issue Aug 8, 2018 · 1 comment

Comments

@Manmeetsm
Copy link

EF core 2.1.1 is generating incorrect SQL for order by columns.

await context.IndustryType
  .OrderBy(x => x.Name)
  .Select(x => new LookupValue { Id = x.IndustryTypeId, Text = x.Name, Code = x.Name })
  .ToListAsync();

Generates : -

SELECT [e].[IndustryTypeId] AS [Id], [e].[Name] AS [Code] ## Missing Text Alias ##
FROM [IndustryType] AS [e]
ORDER BY [Text] 

It should be

SELECT [e].[IndustryTypeId] AS [Id], 
[e].[Name] AS [Text],  # This is Missing #
[e].[Name] AS [Code] 
FROM [IndustryType] AS [e]
ORDER BY [Text] 
@Manmeetsm Manmeetsm changed the title OrderBY conversion to sql is invalid Missing column from Sql Generated Aug 8, 2018
@smitpatel
Copy link
Contributor

Duplicate of #12180

@smitpatel smitpatel marked this as a duplicate of #12180 Aug 8, 2018
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants