Struct MigrationVersion
Identifies a migration's position in the ordered sequence: the application version it ships with, then an explicit order within that version. Sorts by semantic version, then order.
public readonly record struct MigrationVersion : IComparable<MigrationVersion>, IEquatable<MigrationVersion>
- Implements
- Inherited Members
Constructors
MigrationVersion(string, int)
Identifies a migration's position in the ordered sequence: the application version it ships with, then an explicit order within that version. Sorts by semantic version, then order.
public MigrationVersion(string AppVersion, int Order)
Parameters
Properties
AppVersion
public string AppVersion { get; init; }
Property Value
Order
public int Order { get; init; }
Property Value
Methods
CompareTo(MigrationVersion)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(MigrationVersion other)
Parameters
otherMigrationVersionAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
IsAtOrBelow(string)
True when this version is at or below appVersion (semver compare).
public bool IsAtOrBelow(string appVersion)
Parameters
appVersionstring
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.