sing (var context = new TestDBEntities())
{
var query = from p in context.Parents
where p.Name == "Lingzhi"
select p;
ObjectQuery<Parent> parents = query as ObjectQuery<Parent>;
if (parents != null)
{
string sql = parents.ToTraceString();
}
}
转载于:https://www.cnblogs.com/jishufangui/archive/2013/01/23/2872709.html