Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var builder    = Wireup.UseInternalContainer();
            var repository = builder.ResolveRepository();

            var correlationId = Guid.NewGuid();

            var simpleSaga = new VerySimpleSaga()
            {
                CorrelationId = correlationId,
                SagaData      = new DataStorage(),
                Headers       = new Dictionary <string, string>(),
            };

            repository.Save(simpleSaga); // initiate

            var result = simpleSaga.Consume(new SimpleMessage()
            {
                CorrelationId = correlationId, Value = "blah"
            });

            if (result.IsSuccessful)
            {
                repository.Save(simpleSaga);
            }

            Console.ReadKey();
        }
Exemplo n.º 2
0
        public Metadata()
        {
            var messageSerialiser = Wireup.UseInternalContainer().Resolve <IMessageSerialiser>();

            var simpleSaga = new VerySimpleSaga();
            var metadata   = simpleSaga.GetSagaMetadata(messageSerialiser);
        }