title: How does a new ASP.NET MVC 5 application know how to create a database and how does the Account Controller access the database?
body: <p>I created an <strong><em>ASP.NET MVC 5</em></strong> Application using <strong><em>Visual Studio 2013 Update 2</em></strong>. In the application, I have an Account controller. It's different from what I am used to and does not 
  contain an instantiation of <strong><em>dbcontext</em></strong>. </p>
  
  <pre><code>public class AccountController : Controller
  {
      private ApplicationUserManager _userManager;
  
      public AccountController()
      {
      }
  
      public AccountController(ApplicationUserManager userManager)
      {
          UserManager = userManager;
      }
  
      public ApplicationUserManager UserManager {
          get
          {
              return _userManager ?? HttpContext.GetOwinContext().GetUserManager&lt;ApplicationUserManager&gt;();
          }
          private set
          {
              _userManager = value;
          }
      }
  </code></pre>
  
  <p>My <code>web.config</code> that is created by default has a connection string like this:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-WebApplication3-20140417072624.mdf;Initial Catalog=aspnet-WebApplication3-20140417072624;Integrated Security=True"
        providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Can someone explain to me how the application knows to create a database for this application when it starts for the first time? </p>
  
  <p>Also, on subsequent starts, does it use Entity Framework to access the Identity tables to do the authentication? </p>