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

Query: Translate String.CompareTo() #7095

Closed
toralux opened this issue Nov 22, 2016 · 2 comments
Closed

Query: Translate String.CompareTo() #7095

toralux opened this issue Nov 22, 2016 · 2 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@toralux
Copy link

toralux commented Nov 22, 2016

To reproduce

@rowanmiller
See this attached example to reproduce:

efcore_example.zip

Small Console-app example that shows SQL-server filtering.

It works / generates SQL when filtering on >= and <= for int-values:
SELECT [p].[Id], [p].[Age], [p].[Name]
FROM [Persons] AS [p]
WHERE ([p].[Age] >= @__range_Start_0) AND ([p].[Age] <= @__range_End_1)

It doesn't work / doesn't generate SQL when filtering using Compare/CompareTo for string-values:
The LINQ expression '(False OrElse (([_1].Name.CompareTo(__range_Start_0) >= 0) AndAlso ([_1].Name.CompareTo(__range_End_1) <= 0)))' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.

To reproduce:

dotnet restore
dotnet run

Further technical details

EF Core version: 1.1.0
$ dotnet --version
1.0.0-preview2-1-003177

Relates to these other issues #1767, #3464, #5369

@rowanmiller rowanmiller changed the title Support for String.CompareTo() in EF Core 1.1.0 Query: Translate String.CompareTo() Nov 22, 2016
@rowanmiller rowanmiller added this to the 1.2.0 milestone Nov 22, 2016
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Apr 19, 2017
@smitpatel
Copy link
Contributor

@maumar @anpete - Is this important enough for 2.0?
If yes then can I take this?

@maumar maumar assigned smitpatel and unassigned maumar Apr 28, 2017
@anpete
Copy link
Contributor

anpete commented Apr 28, 2017

Looks easy so sure.

@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label May 9, 2017
@bricelam bricelam modified the milestones: 2.0.0, 2.0.0-preview2 May 16, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview2, 2.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

7 participants