I am building the MSV Music Store http://www.asp.net/mvc/tutorials/mvc-music-store
I ran into a roadblock where there was an issue with the Entity Framework.
using System.Data.Entity;
namespace MvcMusicStore.Models
{
public class MusicStoreEntities : DbContext
{
public DbSet<Album> Albums { get; set; }
public DbSet<Genre> Genres { get; set; }
}
}
There error I was getting was...
Error 1 The type or namespace name 'DBContext' could not be found (are you missing a using directive or an assembly reference?) C:\ASP\MvcMusicStore\Models\MusicStoreEntities.cs 8 39 MvcMusicStore
I then found this question where there was a similar problem...
The type or namespace name 'DbContext' could not be found
EDIT: Using this question I had added the "system.data.entity" reference but was still experiencing the same error.
But then I saw another answer there that resolved the issue which said to change DbContext
to System.Data.Entity.DbContext
This has resolved my issue.
I'm wondering why, as I'm unsure of the purpose having to include System.Data.Entity
, and why simply adding the reference didnt work.