Class MigrationResult
Defines migration result.
public class MigrationResult : UnbrowsableResultBase<int>, IResult<int>, IResultBase
- Inheritance
-
ResultBaseResult<int>MigrationResult
- Implements
-
IResult<int>IResultBase
- Inherited Members
-
Result<int>.WithValue(int)Result<int>.ToResult()Result<int>.ToString()Result<int>.ValueOrDefaultResult<int>.ValueResultBase<Result<int>>.WithReason(IReason)ResultBase<Result<int>>.WithError(IError)ResultBase<Result<int>>.WithError<TError>()ResultBase<Result<int>>.WithSuccess(ISuccess)ResultBase<Result<int>>.WithSuccess<TSuccess>()ResultBase.HasError<TError>()ResultBase.HasException<TException>()ResultBase.HasSuccess<TSuccess>()ResultBase.IsFailedResultBase.IsSuccessResultBase.ReasonsResultBase.ErrorsResultBase.Successes
Constructors
MigrationResult()
Initializes a new instance of the MigrationResult class.
public MigrationResult()
Properties
CommandAttributes
Gets the command names to be executed.
public IReadOnlyCollection<IDictionary<string, string>>? CommandAttributes { get; init; }
Property Value
CurrentSchema
Gets the current schema.
public INeosSchema? CurrentSchema { get; init; }
Property Value
MigrationId
Gets the migration identifier.
public int? MigrationId { get; init; }
Property Value
- int?
MigrationStatus
Gets the migration status.
public MigrationStatus MigrationStatus { get; init; }
Property Value
PreviousSchema
Gets the previous schema.
public INeosSchema? PreviousSchema { get; init; }
Property Value
Methods
Fail(IError)
Creates a failed result with the given error.
public static MigrationResult Fail(IError error)
Parameters
errorIErrorThe error.
Returns
- MigrationResult
A new failed MigrationResult instance.
Fail(IEnumerable<IError>)
Creates a failed result with the given errors.
public static MigrationResult Fail(IEnumerable<IError> errors)
Parameters
errorsIEnumerable<IError>The list of errors.
Returns
- MigrationResult
A new failed MigrationResult instance.
Fail(int, IEnumerable<IError>)
Creates a failed result with the given error message and the migration identifier.
public static MigrationResult Fail(int id, IEnumerable<IError> errors)
Parameters
idintThe migration identifier.
errorsIEnumerable<IError>The errors.
Returns
- MigrationResult
A new failed MigrationResult instance.
Fail(string)
Creates a failed result with the given error message.
public static MigrationResult Fail(string errorMessage)
Parameters
errorMessagestringThe error message.
Returns
- MigrationResult
A new failed MigrationResult instance.
Ok()
Creates a success result.
public static MigrationResult Ok()
Returns
- MigrationResult
A new success MigrationResult instance.
Ok(IDictionary<string, string>[])
Creates a success result with additional properties.
public static MigrationResult Ok(IDictionary<string, string>[] commandAttributes)
Parameters
commandAttributesIDictionary<string, string>[]The command attributes to be executed.
Returns
- MigrationResult
A new success MigrationResult instance.
Ok(int, MigrationStatus)
Creates a success result with additional properties.
public static MigrationResult Ok(int id, MigrationStatus status)
Parameters
idintThe migration identifier.
statusMigrationStatusThe migration status.
Returns
- MigrationResult
A new success MigrationResult instance.
Ok(int, INeosSchema?, INeosSchema?)
Creates a success result with additional properties.
public static MigrationResult Ok(int id, INeosSchema? previous = null, INeosSchema? current = null)
Parameters
idintThe migration identifier.
previousINeosSchemaThe previous schema of the database.
currentINeosSchemaThe current schema of the database.
Returns
- MigrationResult
A new success MigrationResult instance.
Success(string)
Creates a success result with the given message.
public static MigrationResult Success(string successMessage)
Parameters
successMessagestringThe success message.
Returns
- MigrationResult
A new succeeded MigrationResult instance.