title: How to move MVC 5 IdentityModels.cs into a separate assembly
body: <p>I wonder if someone ran into the issue that I am having with trying to move <code>ApplicationUser</code> into Models project (where all other models reside including the ones related to Users table).</p>
  
  <p>My test MVC 5 solution consists of a web project and two class libraries: one for data access layer (DAL) and the other for Models. I references AspNet.Identity.EntityFramework in all three projects.
  In my DAL class I implement Repository pattern and a UnitOfWork. UnitOfWork extends <code>IdentityDbContext&lt;ApplicationUser&gt;</code>. ApplicationUser : IdentityUser is in Models class library.</p>
  
  <p>In my web project UnitOfWork is instantiated using Autofac DI.
  For regular controllers I defined a base class that inherits from Controller and takes IUnitOfWork as a parameter in the constructor. All controllers inherit from my custom base controller. 
  I ran into a problem with <code>AccountController</code>. It has two constructors: one with no parameters that seems to instantiate <code>ApplicationDbContext</code>, the other takes UserManager as a parameter. </p>
  
  <p>The parameter-less constructor gives me most of the grief. I tried many things: make <code>accountcontroller</code> inherit from my custom base controller, then try to inherit it from the Controller class. At best I succeed in making my solution compile but when I test the app and fill out user Registration form I get 'Object is not instantiated' message. When I debug I see that the second constructor in <code>AccountController</code> gets called but <code>UserManager</code> is null there.</p>
  
  <p>Any ideas? I would really appreciate somebody's brainy input into this.</p>