0

i want to join two tables with entity framework extension method. i want to get albums from MusicAlbums table and get musics from PlayLists.

my Code :

var result = db.MusicAlbums.Include(p => p.PlayLists)
    .Where(p => p.userID == uID && p.aktifMi == true).ToList();

I can get all musics and albums but i must filter and i must get only active musics from playlists table.

like this:

var result = db.MusicAlbums.Include(p => p.PlayLists.aktifMi=true)
    .Where(p => p.userID == uID && p.aktifMi == true).ToList();

how to I can write query? my active column name "aktifMi".

DavidG
  • 113,891
  • 12
  • 217
  • 223

0 Answers0