I have a collection called Albums with objects from the Album class. This class has the Songs property, which is a collection of Song objects. Each Song has a unique identifier.
public IQueryable<Album> Albums public class Album { ... public virtual ICollection<Song> Songs { get; set; } ... } public class Song { public int Id { get; set; } ... }
Is it possible, using Linq, to ββfind a song in the album's collection? I have no idea how, I'm new to Ling. I tried a little:
Albums.FirstOrDefault(a => a.Songs.Id == id);
Many thanks,
Vincent
source share