You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn on Migrate() when there are pending model changes #33732
public class EFConfigurationProvider : ConfigurationProvider
{
public EFConfigurationProvider(Action<DbContextOptionsBuilder> optionsAction)
{
OptionsAction = optionsAction;
}
Action<DbContextOptionsBuilder> OptionsAction { get; }
public override void Load()
{
var builder = new DbContextOptionsBuilder<EFConfigurationContext>();
OptionsAction(builder);
using (var dbContext = new EFConfigurationContext(builder.Options))
{
dbContext.Database.Migrate(); // throw PendingModelChangesWarning when dotnet ef migrations add
Data = dbContext.Values.ToDictionary(c => c.Id, c => c.Value);
}
}
}
Activity
Add extension point to Migrate
Add extension point to Migrate
Add extension point to Migrate
Add extension point to Migrate
Add extension point to Migrate
Add extension point to Migrate
Add extension point to Migrate
topstop3416 commentedon Apr 18, 2025
asp.net core configuration provider that reads configuration key-value pairs from a database using Entity Framework Core
dotnet ef migrations add throw PendingModelChangesWarning
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-9.0#custom-configuration-provider