Is there an easy way to see SQL statements generated by EntityDa开发者_StackOverflow社区taSource?
SQL Server profiling/tracing is not an option here.
I used to use NHProf a profiler for NHibernate and it is awesome. So I can surely say that you should try the Entity Framework Profiler
I just checked and, as for NHProf, there is a free trial version.
You can cast to ObjectQuery
and call ToTraceString
:
ObjectSet<User> objectSet = ObjectSet;
var query = (ObjectQuery)(objectSet.Where(u => u.LastName == "Doe").Select(u => u));
string trace = query.ToTraceString();
For tracing/caching you can try the EF Caching and Tracing Provider Wrapper. I haven't had a chance to try it yet, but it's definitely on my to do list.
精彩评论