Exemple #1
0
        public Task Handle(SendMessage message, IMessageHandlerContext context)
        {
            var replyOptions       = new ReplyOptions();
            var outgoingAttachment = replyOptions.Attachments();

            outgoingAttachment.Add(() =>
            {
                var incomingAttachment = context.Attachments();
                return(incomingAttachment.GetStream());
            });
            return(context.Reply(new ReplyMessage(), replyOptions));
        }
        public async Task Handle(SendMessage message, IMessageHandlerContext context)
        {
            var withAttachment = await context.Attachments().GetBytes("withMetadata");

            Assert.Equal("value", withAttachment.Metadata["key"]);
            var replyOptions       = new ReplyOptions();
            var outgoingAttachment = replyOptions.Attachments();

            outgoingAttachment.Add(() =>
            {
                var incomingAttachment = context.Attachments();
                return(incomingAttachment.GetStream());
            });
            await context.Reply(new ReplyMessage(), replyOptions);
        }