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

EFCore3.0 Generate SQL #19026

Closed
naruto1227 opened this issue Nov 22, 2019 · 3 comments
Closed

EFCore3.0 Generate SQL #19026

naruto1227 opened this issue Nov 22, 2019 · 3 comments

Comments

@naruto1227
Copy link

I executed a simple query, but the SQL it generated contained many conditions that I did not want, which was not what I wanted, because the SQL executed in efcore2.2 was perfect

My code
string i = "1";
var contetnt = services.BuildServiceProvider().GetRequiredService();
var info = contetnt.LoginRecord.Where(a => a.UserId == i).ToList();

{91PHN4(ELBVER6K@Z8I%$E

EFCore3.0 Generate SQL

SELECT l.Id, l.LoginIP, l.LoginTime, l.SourceType, l.UserId
FROM LoginRecord AS l
WHERE ((l.UserId = @__i_0) AND (l.UserId IS NOT NULL AND @__i_0 IS NOT NULL)) OR (l.UserId IS NULL AND @__i_0 IS NULL)

image

EFCore2.2 Generate SQL

SELECT a.Id, a.LoginIP, a.LoginTime, a.SourceType, a.UserId
FROM LoginRecord AS a
WHERE a.UserId = @__i_0

@naruto1227
Copy link
Author

I think efcore3.0 is more perfect, what configuration do I need to set

@ajcvickers
Copy link
Member

@maumar to de-dupe.

@maumar
Copy link
Contributor

maumar commented Nov 25, 2019

dupe of #17543

@maumar maumar closed this as completed Nov 25, 2019
@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