I have two tables in sql (Singer, Albums) now my query is as below
IQuerable<AlbumVM> = (
from c in context.Singers
join d in context.Albums on c.SingerID equals d.SingerID
select new AlbumVM()
{
SingerName = c.SignerName,
AlbumsName = d.AlbumName
} );
Now suppose a singer has 50 columns,this query returns me 50 rows, then I need to iterate through it.
I feel I am missing something here. Is there someway in which I can get just one record as
SingerName , Albums[]
I am using Entity framework code-first.