You've already forked Extensions.Configuration.EntityFrameworkCore
Remove unnecessary TSetting type parameter from ISettingsDbContext & just use ISetting instead
This commit is contained in:
@@ -57,7 +57,7 @@ public record Setting : ISetting
|
||||
public required string Value { get; set; }
|
||||
}
|
||||
|
||||
public class MyDbContext(DbContextOptions<MyDbContext> options) : DbContext(options), ISettingsDbContext<DbSet<Setting>, Setting>, ISettingsDbContextFactory<MyDbContext>
|
||||
public class MyDbContext(DbContextOptions<MyDbContext> options) : DbContext(options), ISettingsDbContext<DbSet<Setting>>, ISettingsDbContextFactory<MyDbContext>
|
||||
{
|
||||
public DbSet<Setting> Settings { get; set; }
|
||||
|
||||
@@ -72,7 +72,7 @@ builder.Configuration.AddJsonFile("appsettings.json")
|
||||
...
|
||||
.AddUserSecrets<Program>(); // or wherever your connection string lives
|
||||
|
||||
builder.Configuration.AddDbSet<MyDbContext, Setting>(dbContextOptions => dbContextOptions.UseSqlServer(builder.Configuration.GetConnectionString("Default")));
|
||||
builder.Configuration.AddDbContext<MyDbContext>(dbContextOptions => dbContextOptions.UseSqlServer(builder.Configuration.GetConnectionString("Default")));
|
||||
|
||||
...
|
||||
// Add the SqlServerNotificationConfigurationReloader background service and supporting services to obtain setting reloading functionalty
|
||||
|
||||
Reference in New Issue
Block a user