2
public class MySaga<TRequest, TResponse> : Saga<SagaData<TRequest>>,
                                IAmStartedByMessages<TRequest>,
                                IHandleMessages<AsyncResponse>,
                                IHandleTimeouts<TimeOut>
    where TRequest : MyRequest
    where TResponse : MyResponse, new()
{}

public class SagaData<T> : IContainSagaData
{
    public Guid Id { get; set; }
    public string Originator { get; set; }
    public string OriginalMessageId { get; set; }
    public T Request { get; set; }
}

在我在 orderspecifier 中的验证处理程序之后将其连接起来

public class HandlersOrderSpecifier : ISpecifyMessageHandlerOrdering
{
    public void SpecifyOrder(Order order)
    {
        order.Specify(First<ValidationHandler>.Then<MySaga<RequestType,ResponseType>>());
    }
}

仅当我删除它起作用的通用实现细节时,否则我最终会进入 SagaNotFoundHandler。

4

0 回答 0