Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7808927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:16:39+00:00 2026-06-02T03:16:39+00:00

Long time lurker of the forums, I have a question based on the MVC

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:16:40+00:00Added an answer on June 2, 2026 at 3:16 am

    because Album has Artist in it so we can access artist by album:

    namespace MvcMusicStore.Models
    {
        public class Album
        {
            public int      AlbumId     { get; set;
    }
            public int      GenreId     { get; set; }
            public int      ArtistId    { get; set; }
            public string   Title       { get; set; }
            public decimal  Price       { get; set; }
            public string   AlbumArtUrl { get; set; }
            public Genre    Genre       { get; set; }
            public Artist   Artist      { get; set; }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been a long time browser here, but never have had a question that
Long time lurker, first time poster here. My question is: Using C# 2.0, is
Long time reader, first time poster. Working on a web site at http://www.howardpitch.com/ ,
Long time lurker, first time poster. I have a page that can dynamically (with
Long time lurker, first time poster. I have found some good answers on here
First time poster, long time lurker :) I have a form setup that posts
First time question asked long time lurker. I'm working on a Silverlight app with
As a long-time lurker on SO, I'm popping my question cherry with a tricky
Long time ASP.NET Webforms developer, new to Ajax development (mostly via the UpdatePanel control
Newly registered user here after being a long time lurker! I have an Apache

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.