Exemple #1
0
 private void ProcessOrderWithDiscount(SubmitOrder message)
 {
     Bus.Send <ProcessOrder>(m =>
     {
         m.CustomerId = Data.CustomerId;
         m.OrderId    = message.OrderId;
         m.Total      = message.Total * (decimal)0.9;
     });
 }
Exemple #2
0
 private void ProcessOrder(SubmitOrder message)
 {
     Bus.Send <ProcessOrder>(m =>
     {
         m.CustomerId = Data.CustomerId;
         m.OrderId    = message.OrderId;
         m.Total      = message.Total;
     });
 }
Exemple #3
0
 private void ProcessExternalOrder(SubmitOrder message)
 {
     Bus.Send <ProcessOrder>("remote.orderQueue", m =>
     {
         m.CustomerId = Data.CustomerId;
         m.OrderId    = message.OrderId;
         m.Total      = message.Total;
     });
 }
Exemple #4
0
        public void Handle(SubmitOrder message)
        {
            Data.CustomerId    = message.CustomerId;
            Data.RunningTotal += message.Total;

            if (Data.RunningTotal >= 1000)
            {
                ProcessOrderWithDiscount(message);
            }
            else
            {
                ProcessOrder(message);
            }

            RequestUtcTimeout(TimeSpan.FromDays(7), message);
        }
Exemple #5
0
 public void Timeout(SubmitOrder state)
 {
     Data.RunningTotal -= state.Total;
 }