O'Reilly logo
  • Richard Linnell thinks this is interesting:

The output from the code in Listing 2-3 looks like the following:

From

Cover of Entity Framework 6 Recipes, Second Edition

Note

No it doesn't because you didn't save the Artists in the second half of the code, so you just get the albums and no artist.

Try adding
context.Artists.Add(artist1);
context.Artists.Add(artist2);