how to convert linq query to sql query in entity framework 5 ?
Entity framework 5 Log
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
how to convert linq query to sql query in entity framework 5 ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Nov 28, 2014, 6:51 PM EST
Hi Namit Kumar,
You can do the following:
var result = from x in appEntities
where x.id = 32
select x;
var sql = ((System.Data.Objects.ObjectQuery)result).ToTraceString();
or Read these links for details
http://msdn.microsoft.com/en-us/magazine/gg490349.aspx
http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/connection-resiliency-and-command-interception-with-the-entity-framework-in-an-asp-net-mvc-application