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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntityFrameworkCore.Migrator.AspNetCore" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntityFrameworkCore.Migrator.AspNetCore" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="EntityFrameworkCore.Migrator.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EntityFrameworkCore.Migrator.AspNetCore --version 1.0.1
                    
#r "nuget: EntityFrameworkCore.Migrator.AspNetCore, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EntityFrameworkCore.Migrator.AspNetCore@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EntityFrameworkCore.Migrator.AspNetCore&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=EntityFrameworkCore.Migrator.AspNetCore&version=1.0.1
                    
Install as a Cake Tool

Nuget

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.

Migrations Migration

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.

LiveMigrations

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 198 5/6/2024
1.0.0 183 10/16/2023