LINQ in Action roller

Help, LINQ with Subquery

Hello, How would I write a LINQ that looks like this in T-SQL select g.GroupId, g.GroupName, (select count(UserId) from UserGroup where GroupId = g.GroupId) as GroupMemberCount, (select UserId from UserGroup where GroupId = g.GroupId and UserId = @UserId ) as GroupMemberId from [Group] g This query basically returns groups with number of members in it. Notice the line in red? I basically need to find out weather the currently logged in user already is a member of that group or not. I have my dbml Read More...
Published Thursday, July 31, 2008 11:20 PM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication