Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 1.62 KB

README.md

File metadata and controls

38 lines (31 loc) · 1.62 KB

EFCore.TemporalSupport

An implementation of temporal support for EF Core.

Build version

Badges

Badge type Current status
Build status Build status
NuGet nuget
Open Cover Coverage Status
DepShield Badge DepShield Badge

Guide

The following package supports the following methods:

  • AddAsTemporalTable
  • RemoveAsTemporalTable

These are used to add Temporal support to a specific table. Recommendation is to add a new migration file for instance:

    public partial class <InsertYourDate>_addtemporalsupport : Migration
    {

        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.EnsureSchema(name: <SchemaName>);
            migrationBuilder.AddAsTemporalTable(<TableName>, <SchemaName>);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.EnsureSchema(name: <SchemaName>);
            migrationBuilder.RemoveAsTemporalTable(this.TargetModel.FindEntityType(typeof(<ModelType).Name), <SchemaName>);
        }
    }