Exemplo n.º 1
0
 //To know how this method is called, check ...\EventStore.Core\DddSeedwork\EventSourcedAggregateRoot.cs
 //Using dynamic we call the "On(event)" method
 public void On(TicketRegisteredDomainEvent evt)
 {
     Id             = new TicketId(evt.Id);
     Title          = evt.Title;
     Description    = evt.Description;
     TicketType     = evt.TicketType;
     TicketState    = TicketStateMachineBase.GetTicketState(evt.TicketState);
     TicketPriority = evt.TicketPriority;
     User           = evt.User;
 }
Exemplo n.º 2
0
 public TicketStateChangedDomainEvent(TicketStateMachineBase stateMachine)
 {
     State = stateMachine.State;
 }
Exemplo n.º 3
0
 public void On(TicketStateChangedDomainEvent evt)
 {
     TicketState = TicketStateMachineBase.GetTicketState(evt.State);
 }
Exemplo n.º 4
0
 //This is the 'callback' method called from within our ticket state machine.
 /// <summary>
 /// Transition state of our ticket after it passed through our state machine.
 /// Use 'ChangeTicketState' method to properly transition between states.
 /// </summary>
 /// <param name="newState"></param>
 internal void TransitionToState(TicketStateMachineBase newState)
 {
     Apply(new TicketStateChangedDomainEvent(newState));
 }
Exemplo n.º 5
0
 //When changing the state of our ticket, this is what the external classes are calling
 /// <summary>
 /// Change state of our ticket to the given state.
 /// </summary>
 /// <param name="newState"></param>
 public void ChangeTicketState(TicketState newState)
 {
     TicketState.ChangeState(this, TicketStateMachineBase.GetTicketState(newState));
 }