title: The entity type is not part of the model, EF 5
body: <p>I am trying to update my repository to EF5 but have encountered a few errors. I've taken a look around stackoverflow for similar errors discovered a few questions/answers but unfortunately the same answers didn't resolve my issue.</p>
  
  <p>This is my error:</p>
  
  <pre><code>The entity type User is not part of the model for the current context.
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  </code></pre>
  
  <p>This is my DbContext class:</p>
  
  <pre><code>public abstract class WebModelContext : DbContext
  {
      public WebModelContext()
          : base("WebConnection")
      {
          Configuration.LazyLoadingEnabled = true;
      }
  }
  </code></pre>
  
  <p>This is my context class that inherits my <code>WebModelContext</code> class:</p>
  
  <pre><code>public class AccountContext : WebModelContext
  {
      private DbSet&lt;User&gt; _users;
  
      public AccountContext()
          : base()
      {
          _users = Set&lt;User&gt;();
      }
  
      public DbSet&lt;User&gt; Users
      {
          get { return _users; }
      }
  }
  </code></pre>
  
  <p>This is my repository class:</p>
  
  <pre><code>public abstract class IRepository&lt;T&gt; : IDisposable where T : WebModelContext, new()
  {
      private T _context;
  
      protected T Context
      {
          get { return _context; }
      }
  
      public IRepository() {
          _context = new T();
      }
  
      public void Dispose()
      {
          Dispose(true);
          GC.SuppressFinalize(this);
      }
  
      ~IRepository() 
      {
          Dispose(false);
      }
  
      protected virtual void Dispose(bool disposing)
      {
          if (disposing) 
          {
              if (_context != null)
              {
                  _context.Dispose();
                  _context = null;
              }
          }
      }
  
  }
  </code></pre>
  
  <p>This is my AccountRepository class:</p>
  
  <pre><code>public class AccountRepository : IRepository&lt;AccountContext&gt;
  {
      public List&lt;User&gt; GetUsers()
      {
          return Context.Users.ToList();
      }
  
      public User GetUser(string username)
      {
          return Context.Users.Where(u =&gt; u.Name == username).FirstOrDefault();
      }
  
      public User CreateUser(string username, string password, string salt, int age, int residence)
      {
          User user = new User
          {
              Name = username,
              Password = password,
              Salt = salt,
              RoleId = 1,
              CreatedOn = DateTime.Now,
              Locked = false,
              Muted = false,
              Banned = false,
              Guid = Guid.NewGuid().ToString("N")
          };
          Context.Users.Add(user);
          return Context.SaveChanges() &gt; 0 ? user : null;
      }
  }
  </code></pre>
  
  <p>Any help greatly appreciated :)</p>