Someone from stackoverflow recently helped me form this sql query to return the data i was looking for.
I need to convert this into a LINQ statement so that I can use it inside my ASP.NET MVC3 C# project.
Thanks!
SELECT TOP 4 a.GalleryID, a.GalleryTitle, a.GalleryDate, MAX(b.MediaThumb) AS MediaThumb
FROM Galleries a
INNER JOIN Media b
ON a.GalleryID = b.GalleryID
GROUP BY a.GalleryID, a.GalleryTitle, a.GalleryDate
ORDER BY a.GalleryID desc
Edit: here’s a version that groups as per the T-Sql given: