sync public allowlist from private myoffice
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
namespace MyOffice.Migrations.Sqlite;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MyOffice.DbContext;
|
||||
using MyOffice.Shared;
|
||||
|
||||
public class AppDbContextFactorySqlite : IDesignTimeDbContextFactory<AppDbContext>
|
||||
{
|
||||
public AppDbContext CreateDbContext(string[]? args)
|
||||
{
|
||||
var builder = new DbContextOptionsBuilder<AppDbContext>();
|
||||
|
||||
var sharedConfiguration = SharedConfiguration.Build();
|
||||
var connectionString =
|
||||
args?.FirstOrDefault()
|
||||
?? sharedConfiguration.GetConnectionString("sqlite");
|
||||
|
||||
builder.UseSqlite(connectionString, b => b.MigrationsAssembly("MyOffice.Migrations.Sqlite"));
|
||||
|
||||
var db = new AppDbContext(AppDbContextProvidersEnum.sqlite, builder.Options);
|
||||
db.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
||||
|
||||
return db;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user