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
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();
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)
EFCore2.2 Generate SQL
SELECT a.Id, a.LoginIP, a.LoginTime, a.SourceType, a.UserId
FROM LoginRecord AS a
WHERE a.UserId = @__i_0
The text was updated successfully, but these errors were encountered:
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();
EFCore3.0 Generate SQL
SELECT
l
.Id
,l
.LoginIP
,l
.LoginTime
,l
.SourceType
,l
.UserId
FROM
LoginRecord
ASl
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)EFCore2.2 Generate SQL
SELECT
a
.Id
,a
.LoginIP
,a
.LoginTime
,a
.SourceType
,a
.UserId
FROM
LoginRecord
ASa
WHERE
a
.UserId
= @__i_0The text was updated successfully, but these errors were encountered: