【发布时间】:2012-03-09 12:13:30
【问题描述】:
我正在尝试在实体框架 3,5 中使用 .ToTraceString() 生成 sql 查询; 但我收到以下错误
无法将类型“System.Collections.Generic.List”转换为“System.Data.Objects.ObjectQuery”
我有以下代码 我需要生成sql查询
customers= ent.Customer .Include("UserType") .Include("User") .Where(c => c.Enabled == true) .ToList<Customer>();
如何获取实体框架生成的sql查询。我没有 sql profiler。
非常感谢
【问题讨论】:
标签: c#