Class MigrationAttribute
Marks a class as a data migration and records its title and timestamp.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class MigrationAttribute : Attribute
- Inheritance
-
MigrationAttribute
- Inherited Members
Constructors
MigrationAttribute(string, int, int, int, int, int, int)
Initializes a new instance of the MigrationAttribute class.
public MigrationAttribute(string title, int year, int month, int day, int hour, int minute, int second)
Parameters
titlestringThe migration title.
yearintThe year component of the migration timestamp.
monthintThe month component of the migration timestamp.
dayintThe day component of the migration timestamp.
hourintThe hour component of the migration timestamp.
minuteintThe minute component of the migration timestamp.
secondintThe second component of the migration timestamp.
Properties
Date
Gets the migration timestamp.
public DateTime Date { get; }
Property Value
Id
Gets the stable, ordered identifier of the migration — the timestamp (for ordering and uniqueness) joined with the title. This is what the migration history records.
public string Id { get; }
Property Value
Title
Gets the migration title.
public string Title { get; }