예제 #1
0
        protected override void OnReceive(object message)
        {
            switch (message)
            {
            case GetAwaitingOrders m:
            {
                var actor = Context.ActorOf(AwaitingOrdersQueryHandler.Props());
                actor.Forward(m);
            }
            break;

            case GetCustomerOrdersByState m:
            {
                var actor = Context.ActorOf(CustomerOrdersByStateQueryHandler.Props(m.CustomerId));
                actor.Forward(m);
            }
            break;

            case GetCustomerTickets m:
            {
                var actor = Context.ActorOf(CustomerTicketsQueryHandler.Props(m.CustomerId, m.OrderId));
                actor.Forward(m);
            }
            break;

            case GetCustomerTicketsForEvent m:
            {
                var actor = Context.ActorOf(CustomerTicketsForEventQueryHandler.Props(m.CustomerId, m.EventId));
                actor.Forward(m);
            }
            break;

            case GetOrderEventSeatReservations m:
            {
                var actor = Context.ActorOf(OrderEventSeatReservations.Props(m.OrderId, m.EventId));
                actor.Forward(m);
            }
            break;

            case GetAllEventSeatReservations m:
            {
                var actor = Context.ActorOf(EventSeatReservationsQueryHandler.Props(m.EventId));
                actor.Forward(m);
            }
            break;

            case GetSelectedDelivery m:
            {
                var actor = Context.ActorOf(OrderSelectedDeliveryQueryHandler.Props(m.OrderId));
                actor.Forward(m);
            }
            break;

            case GetSelectedPayment m:
            {
                var actor = Context.ActorOf(OrderSelectedPaymentQueryHandler.Props(m.OrderId));
                actor.Forward(m);
            }
            break;

            case Terminated m:
            {
            }
            break;

            default:
            {
                Unhandled(message);
            }
            break;
            }
        }
예제 #2
0
        protected override void OnReceive(object message)
        {
            switch (message)
            {
            case OrderCommited m:
            {
                Context.ActorOf(AwaitingOrdersQueryHandler.Props()).Forward(m);
                Context.ActorOf(CustomerOrdersByStateQueryHandler.Props(m.CustomerId)).Forward(m);
            }
            break;

            case OrderCompleted m:
            {
                Context.ActorOf(AwaitingOrdersQueryHandler.Props()).Forward(m);
                Context.ActorOf(CustomerOrdersByStateQueryHandler.Props(m.CustomerId)).Forward(m);
            }
            break;

            case OrderCreated m:
            {
                Context.ActorOf(AwaitingOrdersQueryHandler.Props()).Forward(m);
                Context.ActorOf(CustomerOrdersByStateQueryHandler.Props(m.CustomerId)).Forward(m);
            }
            break;

            case OrderDiscarded m:
            {
                Context.ActorOf(AwaitingOrdersQueryHandler.Props()).Forward(m);
                Context.ActorOf(CustomerOrdersByStateQueryHandler.Props(m.CustomerId)).Forward(m);
            }
            break;

            case DeliveryMethodSet m:
            {
                Context.ActorOf(OrderSelectedDeliveryQueryHandler.Props(m.OrderId)).Forward(m);
            }
            break;

            case PaymentMethodSet m:
            {
                Context.ActorOf(OrderSelectedPaymentQueryHandler.Props(m.OrderId)).Forward(m);
            }
            break;

            case ReservationCreated m:
            {
                Context.ActorOf(OrderEventSeatReservations.Props(m.OrderId, m.EventId)).Forward(m);
                Context.ActorOf(EventSeatReservationsQueryHandler.Props(m.EventId)).Forward(m);
            }
            break;

            case ReservationDiscarded m:
            {
                Context.ActorOf(OrderEventSeatReservations.Props(m.OrderId, m.EventId)).Forward(m);
                Context.ActorOf(EventSeatReservationsQueryHandler.Props(m.EventId)).Forward(m);
            }
            break;

            case TicketReserved m:
            {
                Context.ActorOf(CustomerTicketsQueryHandler.Props(m.CustomerId, m.OrderId)).Forward(m);
                Context.ActorOf(CustomerTicketsForEventQueryHandler.Props(m.CustomerId, m.EventId)).Forward(m);
            }
            break;

            case TicketRemoved m:
            {
                Context.ActorOf(CustomerTicketsQueryHandler.Props(m.CustomerId, m.OrderId)).Forward(m);
                Context.ActorOf(CustomerTicketsForEventQueryHandler.Props(m.CustomerId, m.EventId)).Forward(m);
            }
            break;

            case Terminated m:
            {
            }
            break;

            default:
                Unhandled(message);
                break;
            }
        }