Search code examples
c#linqlinq-to-sqllinq-to-entities

Linq query equivalent to sql


I have this code in Linq. Anybody can provide the t-sql. thanks!

var tsr = from t in db.Tngs
from l in t.TngUsr
from td in t.TngDepts
from u in db.Users
where t.TId == tId && u.UserId == l.UserId && u.Departments.DeptId == td.Departments.DeptId

is the second/third from left outer?


Solution

  • Try to run that in LinqPad. It would display the T-SQL equivalent of your linq code. It would even convert that linq expression into the equivalent Lambda expression.