/// <summary> /// Initializes a new instance of the <see cref="ToExpression{TData,TMessage}"/> class. /// </summary> /// <param name="correlation">The underlying <see cref="ICorrelateSagaToMessage">correlation</see>.</param> /// <param name="messageProperty">The message property <see cref="Expression{T}">expression</see> the saga property is correlated with.</param> public ToExpression(ICorrelateSagaToMessage correlation, Expression <Func <TMessage, object> > messageProperty) { Arg.NotNull(correlation, nameof(correlation)); Arg.NotNull(messageProperty, nameof(messageProperty)); this.correlation = correlation; this.messageProperty = messageProperty; }
static void Correlate <TData>(Type sagaType, ICorrelateSagaToMessage correlation) where TData : class, ISagaData => ((ISaga <TData>)FormatterServices.GetUninitializedObject(sagaType)).CorrelateUsing(correlation);
/// <summary> /// Initializes a new instance of the <see cref="SagaCorrelator{TData}"/> class. /// </summary> /// <param name="correlation">The underlying <see cref="ICorrelateSagaToMessage">correlation</see>.</param> public SagaCorrelator(ICorrelateSagaToMessage correlation) { Arg.NotNull(correlation, nameof(correlation)); this.correlation = correlation; }
void ISaga <TData> .CorrelateUsing(ICorrelateSagaToMessage correlation) { Contract.Requires <ArgumentNullException>(correlation != null, nameof(correlation)); }