title: How start migrations EF Core
body: <p>I have several project in a solution. There is a dbContext in the Infrastructure project and I want to migrate, but I get an error. Please tell me what I'm doing wrong and how can I fix it.</p>
  <p><a href="https://i.stack.imgur.com/jXOmF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jXOmF.jpg" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/SM69w.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SM69w.jpg" alt="enter image description here" /></a></p>
  <pre><code>using Infrastructure.Models;
  using Microsoft.EntityFrameworkCore;
  
  namespace Infrastructure
  {
      public class ApplicationDbContext : DbContext
      {
          public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
          : base(options)
          {
          }
  
          public DbSet&lt;EventModel&gt; Event { get; set; }
  
          protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          {
              optionsBuilder.UseNpgsql(GetConnectionString());
          }
  
          private static string GetConnectionString()
          {
              const string databaseName = &quot;myDb&quot;;
              const string databaseUser = &quot;postgres&quot;;
              const string databasePass = &quot;root&quot;;
  
              return $&quot;Server=localhost;&quot; +
                     $&quot;database={databaseName};&quot; +
                     $&quot;uid={databaseUser};&quot; +
                     $&quot;pwd={databasePass};&quot; +
                     $&quot;pooling=true;&quot;;
          }
      }    
  }
  
  </code></pre>