Answers for "services.AddDbContext DataSource Sqlite"

SQL
0

services.AddDbContext DataSource Sqlite

-- 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> ();
Posted by: Guest on November-18-2020

Code answers related to "services.AddDbContext DataSource Sqlite"

Code answers related to "SQL"

Browse Popular Code Answers by Language