private void StartNewSaga(IEventMessage @event, AssociationValue associationValue, Segment segment) { var newSaga = _sagaRepository.CreateInstance(CreateSagaIdentifier(segment), _sagaFactory); newSaga.AssociationValues.Add(associationValue); DoInvokeSaga(@event, newSaga); }
public bool Remove(AssociationValue associationValue) { var removed = _values.Remove(associationValue); if (removed) { if (!_addedValues.Remove(associationValue)) { _removedValues.Add(associationValue); } } return(removed); }
protected abstract void DoAssociateWith(AssociationValue associationValue);
protected abstract void DoRemoveAssociation(AssociationValue associationValue);
public static void AssociateWith(AssociationValue associationValue) { Instance.DoAssociateWith(associationValue); }
public bool Contains(AssociationValue associatedValue) => _values.Contains(associatedValue);
protected override void DoRemoveAssociation(AssociationValue property) => AssociationValues.Remove(property);
protected override void DoAssociateWith(AssociationValue property) => AssociationValues.Add(property);