I'm not that familiar with LINQ. I need this query converted into a LINQ statement for use inside my C# project.
Thanks
SELECT Galleries.GalleryTitle, Media.*
FROM Galleries
INNER JOIN Media ON Galleries.GalleryID = Media.GalleryID
WHERE (Galleries.GalleryID = 100)
var query = from g in db.Galleries
join m in db.Media on g.GalleryID equals m.GalleryID into gm
where g.GalleryID == 100
select new { g.GalleryTitle, Media = gm };
Property Media
will contain list of joined media entities. Also if you have navigation property defined in Gallery entity, then:
var gallery = db.Galleries.Include("Media")
.FirstOrDefault(g => g.GalleryID == 100);