Long time lurker of the forums, I have a question based on the MVC Music Store Tutorial (http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-4) I am following.
The tutorial uses EF Code First to set up a CE database. However there are three models Album, Genre and Artist as class files. Now 1 Album can have many Artists however the code only mentions the Genre and Artist:
using System.Data.Entity;
namespace MvcMusicStore.Models
{
public class MusicStoreEntities : DbContext
{
public DbSet<Album> Albums { get; set; }
public DbSet<Genre> Genres { get; set; }
}
}
Why doesn’t this code mention say:
public DbSet<Artist> Artists { get; set; }
Thank for reading. I hope I am not being too stupid.
because Album has Artist in it so we can access artist by album: