PosInformatique.Foundations.EntityFramework.Migrations 1.2.0-rc.3

Prefix Reserved
This is a prerelease version of PosInformatique.Foundations.EntityFramework.Migrations.
dotnet add package PosInformatique.Foundations.EntityFramework.Migrations --version 1.2.0-rc.3
                    
NuGet\Install-Package PosInformatique.Foundations.EntityFramework.Migrations -Version 1.2.0-rc.3
                    
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="PosInformatique.Foundations.EntityFramework.Migrations" Version="1.2.0-rc.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PosInformatique.Foundations.EntityFramework.Migrations" Version="1.2.0-rc.3" />
                    
Directory.Packages.props
<PackageReference Include="PosInformatique.Foundations.EntityFramework.Migrations" />
                    
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 PosInformatique.Foundations.EntityFramework.Migrations --version 1.2.0-rc.3
                    
#r "nuget: PosInformatique.Foundations.EntityFramework.Migrations, 1.2.0-rc.3"
                    
#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 PosInformatique.Foundations.EntityFramework.Migrations@1.2.0-rc.3
                    
#: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=PosInformatique.Foundations.EntityFramework.Migrations&version=1.2.0-rc.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PosInformatique.Foundations.EntityFramework.Migrations&version=1.2.0-rc.3&prerelease
                    
Install as a Cake Tool

PosInformatique.Foundations.EntityFramework.Migrations

NuGet version NuGet downloads

Introduction

Provides extension methods for the Entity Framework Core MigrationBuilder to simplify common migration operations that are not natively supported, such as renaming foreign key and primary key constraints.

Install

You can install the package from NuGet:

dotnet add package PosInformatique.Foundations.EntityFramework.Migrations

Features

  • Provides a RenameForeignKey() extension method to rename an existing foreign key constraint.
  • Provides a RenamePrimaryKey() extension method to rename an existing primary key constraint.
  • Currently supports only the SQL Server provider (Microsoft.EntityFrameworkCore.SqlServer).
  • Throws a NotSupportedException when used with a provider other than SQL Server.

Use cases

  • Migration authoring: rename constraints created by Entity Framework Core migrations without writing raw SQL by hand.
  • Consistency: keep constraint renaming logic centralized and reusable across migrations.
  • Safety: values are escaped to avoid SQL injection issues when building the underlying sp_rename statement.

Examples

Example: Rename a foreign key constraint

using Microsoft.EntityFrameworkCore.Migrations;

public partial class RenameOrderCustomerForeignKey : Migration
{
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.RenameForeignKey("FK_Orders_Customers_CustomerId", "FK_Orders_Customer");
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.RenameForeignKey("FK_Orders_Customer", "FK_Orders_Customers_CustomerId");
    }
}

Example: Rename a primary key constraint

using Microsoft.EntityFrameworkCore.Migrations;

public partial class RenameOrderPrimaryKey : Migration
{
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.RenamePrimaryKey("PK_Orders", "PK_Order");
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.RenamePrimaryKey("PK_Order", "PK_Orders");
    }
}

Example: Rename a constraint in a non-default schema

migrationBuilder.RenameForeignKey("FK_Orders_Customers_CustomerId", "FK_Orders_Customer", schema: "sales");
Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 is compatible.  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.2.0-rc.3 42 7/17/2026
1.2.0-rc.2 40 7/17/2026

1.2.0
 - Initial release with the support Entity Framework persitance for MimeType value object.