Translate SQL query to LINQ

Posted by ile on Stack Overflow See other posts from Stack Overflow or by ile
Published on 2010-03-31T12:48:08Z Indexed on 2010/03/31 12:53 UTC
Read the original article Hit count: 266

Filed under:
|
|

PhotoAlbums table
AlbumID
Title
Date

Photos table:
PhotoID
Title
Date
AlbumID

SELECT     AlbumID, Title, Date,
                          (SELECT     TOP (1) PhotoID
                            FROM          Photos AS c
                            WHERE      (AlbumID = a.AlbumID)) AS PhotoID
FROM         PhotoAlbums AS a

I need this query written in LINQ-to-SQL. Thanks in advance

© Stack Overflow or respective owner

Related posts about translate

Related posts about sql