/// <summary> /// Initializes a new instance of <see cref="ToSagaExpression{TSagaData,TMessage}" />. /// </summary> public ToSagaExpression(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration, Expression <Func <TMessage, object> > messageProperty) { Guard.AgainstNull(nameof(sagaMessageFindingConfiguration), sagaMessageFindingConfiguration); Guard.AgainstNull(nameof(messageProperty), messageProperty); this.sagaMessageFindingConfiguration = sagaMessageFindingConfiguration; this.messageProperty = messageProperty; }
/// <summary> /// <see cref="Saga.ConfigureHowToFindSaga"/>. Do not override this method. /// </summary> protected override void ConfigureHowToFindSaga(IConfigureHowToFindSagaWithMessage mapper) { VerifyNoConfigureHowToFindSaga(); VerifyBase(); var propertyMapper = new PropertyMapper <TSagaData>(mapper, GetExpression(), GetType()); ConfigureMapping(propertyMapper); }
/// <summary> /// Override this method in order to configure how this saga's data should be found. /// </summary> /// <remarks>Override <see cref="Saga.ConfigureHowToFindSaga"/> and forwards it to the generic version <see cref="ConfigureHowToFindSaga(SagaPropertyMapper{TSagaData})"/></remarks> internal protected override void ConfigureHowToFindSaga(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration) { ConfigureHowToFindSaga(new SagaPropertyMapper <TSagaData>(sagaMessageFindingConfiguration)); }
protected internal override void ConfigureHowToFindSaga(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration) { }
protected override void ConfigureHowToFindSaga(IConfigureHowToFindSagaWithMessage mapper) { }
/// <summary> /// Override this method in order to configure how this saga's data should be found. /// </summary> protected internal abstract void ConfigureHowToFindSaga(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration);
/// <summary> /// Constucts the expression /// </summary> /// <param name="sagaMessageFindingConfiguration"></param> /// <param name="messageProperty"></param> public ToSagaExpression(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration, Expression <Func <TMessage, object> > messageProperty) { this.sagaMessageFindingConfiguration = sagaMessageFindingConfiguration; this.messageProperty = messageProperty; }
internal SagaPropertyMapper(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration) { this.sagaMessageFindingConfiguration = sagaMessageFindingConfiguration; }
protected override void ConfigureHowToFindSaga(IConfigureHowToFindSagaWithMessage mapper) { mapper.ConfigureMapping <PaymentSagaData, RequestPayment>(message => message.PaymentId, payment => payment.PaymentId); mapper.ConfigureMapping <PaymentSagaData, CompletePayment>(message => message.PaymentId, payment => payment.PaymentId); mapper.ConfigureMapping <PaymentSagaData, CancelPayment>(message => message.PaymentId, payment => payment.PaymentId); }
internal PropertyMapper(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration, Expression <Func <TSagaData, object> > sagaEntityProperty, Type sagaType) { this.sagaMessageFindingConfiguration = sagaMessageFindingConfiguration; this.sagaEntityProperty = sagaEntityProperty; this.sagaType = sagaType; }