How to use Linq To Sql to get Users who has more than 2 photos?

Posted by Mike108 on Stack Overflow See other posts from Stack Overflow or by Mike108
Published on 2010-04-05T12:11:02Z Indexed on 2010/04/05 12:13 UTC
Read the original article Hit count: 188

Filed under:

The scenario is I want to get the users who has more than 2 photos.

There are two table:

[Users] (UserId, UserName) 

[UserPhotos] (PhotoId, PhotoName, UserId) and UserId is a Foreign Key.

A user may have none photo in the [UserPhotos] table.

How to use Linq To Sql to get List who has more than 2 photos?

© Stack Overflow or respective owner

Related posts about linq-to-sql