Entity Framework 4.0 中是这样的,高版本的跟这个有些差异,不太一样,貌似已经到7了
using (Entities entities = new Entities()) { var query = from st in entities.ShiTi select st; ObjectQuery oq = query as ObjectQuery; string sql = oq.ToTraceString(); Console.WriteLine(sql); }
Entity Framework 4.0 中是这样的,高版本的跟这个有些差异,不太一样,貌似已经到7了
using (Entities entities = new Entities()) { var query = from st in entities.ShiTi select st; ObjectQuery oq = query as ObjectQuery; string sql = oq.ToTraceString(); Console.WriteLine(sql); }
转载于:https://www.cnblogs.com/cnryb/p/3957925.html