services.AddDbContext DataSource Sqlite
snippet in sql

services.AddDbContext DataSource Sqlite

user8120

-- Using AspNet.3.1 EntityFrameworkCode w Sqlite database
-- Add Context class
public class DatabaseContext : DbContext
{
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseSqlite("Filename=MyDatabase.db");
    }
}
 -- Add to Startup ConfigureServices
 	services.AddEntityFrameworkSqlite ().AddDbContext<DatabaseContext> ();