title: ASP NET CORE Can't scaffold Identity using existing DbContext - how do I specify options when scaffolding?
body: <p>Steps to recreate:</p>
  
  <p>1) create new <code>asp net core</code> mvc project.</p>
  
  <p>2) create a new model and scaffold an API controller with read/write</p>
  
  <p>3) delete bootstrap.css</p>
  
  <p>4) change the created DbContext to inherit from IdentityDbContext</p>
  
  <p>5) try to scaffold an identity</p>
  
  <p>6) get error</p>
  
  <hr>
  
  <p>I've scaffolded a set of objects from a data object which has given me:</p>
  
  <pre><code>namespace WebApplication1.Models
  {
      public class AllTheOtherStuffDbContext : DbContext
      {
          public AllTheOtherStuffDbContext() : base("name=AllTheOtherStuffDbContext")
          { }
  
          public System.Data.Entity.DbSet&lt;WebApplication1.Models.Movie&gt; Movies { get; set; }
  
      }
  } 
  </code></pre>
  
  <p>Now I'm trying to scaffold an identity set for my db but using the same context, so I change <code>DbContext</code> to <code>IdentityDbContext&lt;IdentityUser&gt;</code> as per some different answers I've found, but when scaffolding and generating code, I get this message:</p>
  
  <pre><code>Cannot use an existing DbContext with the '--useDefaultUI' option.
  </code></pre>
  
  <p>I looked up <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.web.codegenerators.mvc.identity.identitygeneratorcommandlinemodel.usedefaultui?view=aspnetcore-2.2" rel="nofollow noreferrer">UseDefaultUI</a>...</p>
  
  <p>and in a separate project I see by scaffolding an Identity I get this line added to my startup.cs:</p>
  
  <p><code>services.AddDefaultIdentity&lt;IdentityUser&gt;()
                  .AddDefaultUI(UIFramework.Bootstrap4)
                  .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();</code></p>
  
  <p>I presume the problem now is because I got rid of Bootstrap in my current project (because I hate it) so I want to STOP the scaffolding from trying to add that <code>DefaultUI</code> line - how can I do this while using visual studio? Can I specify a command line instead of using the menu option to add scaffolding?</p>