Today, when I look at the SQL statement generated by the Entity Framework Core with SQL Server Profiler, I suddenly find a detail improvement, and it shook it a bit:
exec sp_executesql N'[u]WHERE [u].[ LoginName] = @__loginname_0', N'@__loginname_0 nvarchar (+)',@__ Loginname_0=N'test'
The Shock is the U (alias of the table), which is not a random name for EF Core, but a name from the LINQ code:
Public Iqueryable<user> getbyloginname (string loginName) { return _users. Where (u = u.loginname = = LoginName);}
Compare the SQL statements generated by the Entity Framework:
exec sp_executesql N'SELECT TOP (1) [extent1].[ UserID] as [userid] [Extent1] WHERE ([extent1].[ LoginName] = @p__linq__0)', N'@p__linq__0 nvarchar',@p__linq_ _0=N'test'
The Extent1 here is a casual name.
Well, the Entity Framework Core is pretty dry!
Shocked by the improvements in the details of the entity Framework core