Shocked by the improvements in the details of the entity Framework core

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.