# Entity Framework

Miru uses Entity Framework Core to persist entities.

Although EFCore supports many database, at the moment Miru supports these:

  • SqlServer
  • Sqlite

Miru has database facilities in other areas, such as Migrations and Tests. That's why few databases are supported.

# Configuration

# Services

To add EFCore with SqlServer:

public void ConfigureServices(IServiceCollection services)
{
    services.AddMiru<Startup>()
        .AddEfCoreSqlServer<SupportreonDbContext>()
}

To add EFCore with SqlSqite:

public void ConfigureServices(IServiceCollection services)
{
    services.AddMiru<Startup>()
        .AddEfCoreSqlite<SupportreonDbContext>()
}

# Connection String

Set in your Config.{Environment}.yml:

Database:
  ConnectionString: "DataSource={{ db_dir }}App_dev.db"

# DbContext

By default, the DbContext is located at /src/{App}/Database/