title: Create database dynamically with migrations
body: <p>I have an application that when user registers, there will be a new database created for that specific user. My questions: Is this the proper way to create the database dynamically based on EF Core 2.0 Code First and apply migrations?</p>
  
  <p>Assuming I have my context: <code>CustomDbContext</code>, and in the Registration Action I have like this:</p>
  
  <pre><code>    [HttpPost]
      public async Task&lt;IActionResult&gt; Register(RegisterViewModel model)
      {           
  
          //register user logic here
  
          using (CustomDbContext ctx = new CustomDbContext())
          {
               await ctx.Database.EnsureCreatedAsync();   
               await ctx.Database.MigrateAsync();
          }           
  
          return RedirectToPage("/Index");
      }
  </code></pre>
  
  <p>Does <code>await ctx.Database.EnsureCreatedAsync();</code> also apply the migrations? or I do need to run <code>await ctx.Database.MigrateAsync();</code> to apply them?</p>