Web Api layout
This commit is contained in:
parent
5619093f41
commit
da6d5576bf
32 changed files with 515 additions and 29 deletions
23
design/InkForge.Migrations/NoteDbContextFactory.cs
Normal file
23
design/InkForge.Migrations/NoteDbContextFactory.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using InkForge.Data;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace InkForge.Migrations;
|
||||
|
||||
public class NoteDbContextFactory : MigratingDbContextFactory<NoteDbContext>
|
||||
{
|
||||
protected override void Configure(
|
||||
DbContextOptionsBuilder<NoteDbContext> optionsBuilder,
|
||||
string connectionString,
|
||||
string provider
|
||||
) => _ = provider switch
|
||||
{
|
||||
"Sqlite" => optionsBuilder.UseSqlite(connectionString,
|
||||
m => m.MigrationsAssembly("InkForge.Sqlite")
|
||||
),
|
||||
|
||||
_ => throw new Exception($"Invalid DbProvider: {provider}")
|
||||
};
|
||||
|
||||
protected override NoteDbContext CreateDbContext(DbContextOptions<NoteDbContext> options) => new(options);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue