Table of Contents

Struct MigrationVersion

Namespace
CL.MySQL2.Models
Assembly
CL.MySQL2.dll

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

AppVersion string
Order int

Properties

AppVersion

public string AppVersion { get; init; }

Property Value

string

Order

public int Order { get; init; }

Property Value

int

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

other MigrationVersion

An 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 other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

IsAtOrBelow(string)

True when this version is at or below appVersion (semver compare).

public bool IsAtOrBelow(string appVersion)

Parameters

appVersion string

Returns

bool

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.