EntityFrameworkCore.Migrator.AspNetCore
1.0.1
dotnet add package EntityFrameworkCore.Migrator.AspNetCore --version 1.0.1
NuGet\Install-Package EntityFrameworkCore.Migrator.AspNetCore -Version 1.0.1
<PackageReference Include="EntityFrameworkCore.Migrator.AspNetCore" Version="1.0.1" />
<PackageVersion Include="EntityFrameworkCore.Migrator.AspNetCore" Version="1.0.1" />
<PackageReference Include="EntityFrameworkCore.Migrator.AspNetCore" />
paket add EntityFrameworkCore.Migrator.AspNetCore --version 1.0.1
#r "nuget: EntityFrameworkCore.Migrator.AspNetCore, 1.0.1"
#:package EntityFrameworkCore.Migrator.AspNetCore@1.0.1
#addin nuget:?package=EntityFrameworkCore.Migrator.AspNetCore&version=1.0.1
#tool nuget:?package=EntityFrameworkCore.Migrator.AspNetCore&version=1.0.1
UI for managing EF Core migrations
Tool that provides you a UI to make your migration management a little bit easier.
For detailed documentation, please visit https://ezpz.codes/efcore-migrator.
Migration management
You can manage the migration created through CLI with the provided UI. The tool generates SQL that would executed on the database before running the migration so you can make sure everything is as expected.
Live migrations
You can also generate and run SQL script that automatically migrate your database from the current state to the state you have in your code, without the need for any migrations. You can also modify all the migration operations generated by EF Core before generating the commands.
Setup
In Program.cs
file, the following lines of code are needed:
using EntityFrameworkCore.Migrator.AspNetCore;
using Microsoft.EntityFrameworkCore;
// ...
builder.Services.AddDbContext<TestDbContext>(...);
builder.Services.AddEntityFrameworkCoreMigrator<TestDbContext>();
builder.Services.AddRazorPages();
// ...
var app = builder.Build();
// ...
app.UseStaticFiles();
// ...
app.MapRazorPages();
// ...
app.Run();
Then you can navigate to /Migrator
to access the UI.
Authorization
In development mode, you do not need to setup any authorization, but in production it is mandatory for security purposes. You can either set up authorization by restricting by role, or writing a custom method for authorization.
builder.Services.AddEntityFrameworkCoreMigrator<TestDbContext>(options =>
{
options.RestrictToRoles = new [] { "Admin" };
});
builder.Services.AddEntityFrameworkCoreMigrator<TestDbContext>(options =>
{
options.AuthorizationMethod = async (httpContext) =>
{
// Custom authorization logic
return true;
};
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.EntityFrameworkCore.Design (>= 6.0.0)
-
net7.0
- Microsoft.EntityFrameworkCore.Design (>= 7.0.0)
-
net8.0
- Microsoft.EntityFrameworkCore.Design (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.