问题说明:

EF7 版本(注意 rc):

  • 旧版本:"EntityFramework": "7.0.0-beta2-11758"
  • 新版本:"EntityFramework": "7.0.0-rc1-11823"

测试结果:

EntityFramework 7 Join Count LongCount 奇怪问题(已修复)-LMLPHP

SQL Server Profiler 抓取 SQL 代码(I want):

exec sp_executesql N'SELECT COUNT(*)
FROM [Blog] AS [b]
INNER JOIN [BlogCate] AS [c] ON [b].[BlogCateId] = [c].[CateId]
WHERE ([b].[Url] = @p0 AND [c].[CateName] = @p1)',N'@p0 nvarchar(23),@p1 nvarchar(3)',@p0=N'http://www.cnblogs.com/',@p1=N'ef7'

感谢 EF 团队!

05-08 14:53