Class MigrationPlan
Represents a migration plan.
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public class MigrationPlan
Constructors
MigrationPlan(String)
Declaration
public MigrationPlan(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
The name of the plan.
|
Properties
FinalState
Declaration
public string FinalState { get; }
Property Value
Type |
Description |
System.String |
|
IgnoreCurrentState
If set to true the plan executor will ignore any current state persisted and
run the plan from its initial state to its end state.
Declaration
public virtual bool IgnoreCurrentState { get; }
Property Value
Type |
Description |
System.Boolean |
|
InitialState
Declaration
public virtual string InitialState { get; }
Property Value
Type |
Description |
System.String |
|
Name
Gets the name of the plan.
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
PostMigrationTypes
Declaration
public IReadOnlyList<Type> PostMigrationTypes { get; }
Property Value
Type |
Description |
System.Collections.Generic.IReadOnlyList<System.Type> |
|
Transitions
Declaration
public IReadOnlyDictionary<string, MigrationPlan.Transition> Transitions { get; }
Property Value
Methods
AddPostMigration<TMigration>()
Adds a post-migration to the plan.
Declaration
public virtual MigrationPlan AddPostMigration<TMigration>()
where TMigration : MigrationBase
Returns
Type Parameters
Name |
Description |
TMigration |
|
CreateRandomState()
Creates a random, unique state.
Declaration
public virtual string CreateRandomState()
Returns
Type |
Description |
System.String |
|
From(String)
Declaration
public MigrationPlan From(string sourceState)
Parameters
Type |
Name |
Description |
System.String |
sourceState |
|
Returns
Merge()
Declaration
public MergeBuilder Merge()
Returns
ThrowOnUnknownInitialState(String)
Throws an exception when the initial state is unknown.
Declaration
public virtual void ThrowOnUnknownInitialState(string state)
Parameters
Type |
Name |
Description |
System.String |
state |
|
To(Guid)
Declaration
public MigrationPlan To(Guid targetState)
Parameters
Type |
Name |
Description |
System.Guid |
targetState |
|
Returns
To(Guid, Type)
Declaration
public MigrationPlan To(Guid targetState, Type migration)
Parameters
Type |
Name |
Description |
System.Guid |
targetState |
|
System.Type |
migration |
|
Returns
To(String)
Adds a transition to a target state through an empty migration.
Declaration
public MigrationPlan To(string targetState)
Parameters
Type |
Name |
Description |
System.String |
targetState |
|
Returns
To(String, Type)
Adds a transition to a target state through a migration.
Declaration
public MigrationPlan To(string targetState, Type migration)
Parameters
Type |
Name |
Description |
System.String |
targetState |
|
System.Type |
migration |
|
Returns
To<TMigration>(Guid)
Declaration
public MigrationPlan To<TMigration>(Guid targetState)
where TMigration : MigrationBase
Parameters
Type |
Name |
Description |
System.Guid |
targetState |
|
Returns
Type Parameters
Name |
Description |
TMigration |
|
To<TMigration>(String)
Adds a transition to a target state through a migration.
Declaration
public MigrationPlan To<TMigration>(string targetState)
where TMigration : MigrationBase
Parameters
Type |
Name |
Description |
System.String |
targetState |
|
Returns
Type Parameters
Name |
Description |
TMigration |
|
ToWithClone(String, String, String)
Adds transitions to a target state by cloning transitions from a start state to an end state.
Declaration
public MigrationPlan ToWithClone(string startState, string endState, string targetState)
Parameters
Type |
Name |
Description |
System.String |
startState |
|
System.String |
endState |
|
System.String |
targetState |
|
Returns
ToWithReplace<TMigrationNew>(String, String)
Adds a transition to a target state through a migration, replacing a previous migration.
Declaration
public MigrationPlan ToWithReplace<TMigrationNew>(string recoverState, string targetState)
where TMigrationNew : MigrationBase
Parameters
Type |
Name |
Description |
System.String |
recoverState |
The previous target state, which we can recover from directly.
|
System.String |
targetState |
The new target state.
|
Returns
Type Parameters
Name |
Description |
TMigrationNew |
The new migration.
|
ToWithReplace<TMigrationNew, TMigrationRecover>(String, String)
Adds a transition to a target state through a migration, replacing a previous migration.
Declaration
public MigrationPlan ToWithReplace<TMigrationNew, TMigrationRecover>(string recoverState, string targetState)
where TMigrationNew : MigrationBase where TMigrationRecover : MigrationBase
Parameters
Type |
Name |
Description |
System.String |
recoverState |
The previous target state, which we need to recover from through TMigrationRecover .
|
System.String |
targetState |
The new target state.
|
Returns
Type Parameters
Name |
Description |
TMigrationNew |
The new migration.
|
TMigrationRecover |
The migration to use to recover from the previous target state.
|
Validate()
Declaration