Biljana Biljana - 2 years ago 148
SQL Question

How to convert SQL Query to Lambda Expression

Here is my SQL Query:

FROM aspnet_Users u
INNER JOIN aspnet_Membership m
ON u.UserId = m.UserId

Can anybody help me how to write with lambda expression?

Answer Source

Try this..

from u in context.aspnet_Users 
join m in context.aspnet_Membership on u.UserId equals m.UserId select new { u.UserName, m.IsApproved};
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download