i am following a step by step to learn mvc and creating a music shop but for some reason i cant get the following code to work..
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
namespace MvcMusicStore.Models
{
public class MusicStoreEntities : DbContext
{
public DbSet<Album> Albums { get; set; }
public DbSet<Genre> Genres { get; set; }
}
}
The DBcontext, DbSet and DbSet are giving errors...
Error 1 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
why?
You must add a reference to the EntityFramework.dll
assembly to your project. The simplest way to do this is installing the corresponding NuGet package. If you have installed the ASP.NET MVC 3 Tools Update this NuGet package is referenced by default when you create a new project. If not, simply install it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With