Ejemplo n.º 1
0
        public static async Task post_two(IMessageContext context, SqlTransaction tx)
        {
            var target2 = JsonConvert.DeserializeObject <Target>(_json2);

            target2.Id = Guid.NewGuid();

            await tx.StoreSent(target2.Id, "Target");

            await context.Send(target2);
        }
Ejemplo n.º 2
0
        public static async Task <PongMessage> Handle(PingMessage message, SqlTransaction tx)
        {
            await tx.StoreReceived(message.Id, "PingMessage");

            await tx.StoreSent(message.Id, "PongMessage");

            return(new PongMessage
            {
                Id = message.Id,
                Name = message.Name
            });
        }
Ejemplo n.º 3
0
        public static async Task post_four(IMessageContext context, SqlTransaction tx)
        {
            var created = new UserCreated
            {
                Id     = Guid.NewGuid(),
                UserId = "Chewbacca"
            };

            await tx.StoreSent(created.Id, "UserCreated");

            await context.Send(created);
        }
Ejemplo n.º 4
0
        public static async Task post_three(IMessageContext context, SqlTransaction tx)
        {
            var ping = new PingMessage
            {
                Name = "Han Solo",
                Id   = Guid.NewGuid()
            };

            await tx.StoreSent(ping.Id, "PingMessage");

            await context.SendAndExpectResponseFor <PongMessage>(ping);
        }