コード例 #1
0
partial         void HandleImplementation(PlaceOrderCommand message)
        {
            // TODO: PlaceOrderCommandHandler: Add code to handle the PlaceOrderCommand message.
            Console.WriteLine("Payments received " + message.GetType().Name);
            var createInvoiceCommand = new Example2.Internal.Commands.Payments.CreateInvoiceCommand { UserId = message.UserId };
            Bus.Send(createInvoiceCommand);

            Bus.Publish<ContractCreatedEvent>(x => x.UserId = message.UserId);
            //Bus.Publish<ContractCreatedExtendedEvent>(x =>
            //{
            //    x.UserId = message.UserId;
            //    x.CampaignId = 1;
            //});

            //var orderPlacedEvent = new Example2.Contracts.Payments.OrderPlacedEvent { UserId = message.UserId };
            //Bus.Publish(orderPlacedEvent);
        }
コード例 #2
0
        //public Schedule Scheduler { get; set; }
partial         void HandleImplementation(CreateInvoiceCommand message)
        {
            // TODO: CreateInvoiceCommandHandler: Add code to handle the CreateInvoiceCommand message.
            Console.WriteLine("Payments received " + message.GetType().Name);
            //Scheduler.Every(TimeSpan.FromSeconds(5), () => Bus.Publish<InvoiceSentInEncashmentEvent>(x => x.UserId = message.UserId));
        }