title: MassTransit Saga State to Instance State Mapping
body: <p>I'm new to MassTransit, and I can't seem to figure out how it maps the States that I define on a saga (MassTransitStateMachine) to the "State" property on the related SagaStateMachineInstance class. </p>
  
  <p>For example, if I have a state machine class with three states:</p>
  
  <pre><code>public class MySaga :
     MassTransitStateMachine&lt;MySagaState&gt;
  {
      public State Executing { get; private set; }
      public State Completed { get; private set; }
      public State Failed { get; private set; }
      ...
  }
  </code></pre>
  
  <p>And my state machine instance class has a "State" property</p>
  
  <pre><code>public class MySagaState : SagaStateMachineInstance
  {
      public Guid CorrelationId { get; set; }
      public int State { get; set; }
  }
  </code></pre>
  
  <p>How does MT decide which saga state is which integer? </p>
  
  <p>There also appear to be two built-in saga states, "Initial" and "Final", so this example would have 5 states. How is the State to integer mapping done?</p>