ef怎么查看生成的sql语句

ef4.0以上可以使用tostring();

var sql = DataAccess.LepulsDB.DBContext.Sc_V_PersonalInspection.Select().Where(whereExp).ToString();

 

生成的结果:

SELECT [Sc_V_PersonalInspection].* FROM [Sc_V_PersonalInspection]

posted @ 2016-12-14 14:32  飞刀软件  阅读(524)  评论(0)    收藏  举报