title: How do I properly use my SQLite db in my asp.net core 3.1 MVC application using EF?
body: <p>So I'm trying to create a ASP.NET Core 3.1 MVC application which uses <strong>Identity</strong> and it's working well so far.
  I wanted to add a SQLite db to it so I can store users etc using EF (EntityFramework) Code First and this is what I did.</p>
  
  <p>I first created a database file using SQLite, so I have the Database.db file in a folder on my desktop.</p>
  
  <p>I then tried finding documentations regarding how to implement it, but there were so many and all of them are very different so I couldn't pinpoint what would be the proper way of implementing it.</p>
  
  <p>I started by setting up my Context</p>
  
  <pre><code>public class UserContext : IdentityDbContext
  {
      public DbSet&lt;User&gt; Users { get; set; }
  }
  
  public class User : IdentityUser
  {
      public string CustomerID { get; set; }
  
      public string SubscriptionID { get; set; }
  
      public int IsActive { get; set; }
  }
  </code></pre>
  
  <p>Super straight forward, and then I modified my ConfigureServices method which is in my Startup.cs to <code>AddIdentity</code></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddControllersWithViews();
      services.AddIdentity&lt;User, IdentityRole&gt;().AddEntityFrameworkStores&lt;UserContext&gt;();
  
  }
  </code></pre>
  
  <p>Perfect, now I have Identity added. Great.</p>
  
  <p>Here is the issue, I wanted to be able to create a initial migration to create a table in my database.db file but I have no idea where to put the connectionString and how to access it.</p>
  
  <p>I read on some forums that I should store it inside appsettings.json, but what would the connectionString then look like since it's a file on my disk?</p>
  
  <p>I do not believe that this would work</p>
  
  <pre><code>"ConnectionStrings": {
      "sqlConnection": "Server=C:\\Users\\user\\Desktop\\user\\Database\\Database.db;Database=Blogging;Trusted_Connection=True;\\\""
    }
  </code></pre>
  
  <p>or is that what the connectionString should look like?</p>
  
  <p>How do I properly implement the SQLite database file to my project so that I can access and create my first migration?</p>
  
  <p>I also didn't find a way to create the database.db file with a password when creating it, is this possible to change?</p>