public OrderViewModel CreateViewModel(object @event) { switch (@event) { case OrderAddEvent x: OrderAddEvent orderAddEvent = @event as OrderAddEvent; return(_mapper.Map <OrderViewModel>(orderAddEvent)); case OrderUpdateEvent x: OrderUpdateEvent orderUpdateEvent = @event as OrderUpdateEvent; return(_mapper.Map <OrderViewModel>(orderUpdateEvent)); case OrderRemoveEvent x: OrderRemoveEvent orderRemoveEvent = @event as OrderRemoveEvent; return(_mapper.Map <OrderViewModel>(orderRemoveEvent)); default: return(null); } }
private void OnRemovedOrder(OrderRemoveEvent @event) { Id = @event.Id; }