Newer
Older
AsyncRequestReply / src / Shipping / CreateShippingLabelHandler.cs
@Derek Comartin Derek Comartin on 1 Mar 2022 548 bytes Init
using System;
using System.Threading.Tasks;
using Billing.Contracts;
using NServiceBus;
using Sales.Contracts;
using Shipping.Contracts;

namespace Shipping
{
    public class CreateShippingLabelHandler : IHandleMessages<CreateShippingLabel>
    {
        public async Task Handle(CreateShippingLabel message, IMessageHandlerContext context)
        {
            // Do some work

            // Reply
            await context.Reply(new ShippingLabelCreated
            {
                OrderId = message.OrderId
            });
        }
    }
}