public Task Handle(EmpireQueueCreatedEvent @event)
        {
            var empireQueue = new EmpireQueue
            {
                Id = @event.EmpireQueue.Id,
                TicketCategoryId = @event.EmpireQueue.TicketCategoryId
            };

            _unitOfWork.EmpireQueues.Create(empireQueue);
            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        public Task Handle(EmpireQueueCreatedEvent @event)
        {
            var empireQueue = new EmpireQueue
            {
                Id                 = @event.EmpireQueue.Id,
                Name               = @event.EmpireQueue.Name,
                QueueWeight        = @event.EmpireQueue.QueueWeight,
                ActiveWaitersCount = @event.EmpireQueue.ActiveWaitersCount
            };

            _unitOfWork.EmpireQueues.Create(empireQueue);
            _unitOfWork.BroadcastServerEvent("empire-queue-created", empireQueue);
            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
        public Task <bool> Handle(CreateEmpireQueueCommand request, CancellationToken cancellationToken)
        {
            var empireQueue = new EmpireQueue
            {
                TicketCategoryId   = request.TicketCategory.Id,
                QueueWeight        = request.TicketCategory.PriorityCoefficient,
                ActiveWaitersCount = 0,
                Name = request.TicketCategory.Name
            };

            _unitOfWork.EmpireQueues.Create(empireQueue);
            _bus.Publish(new EmpireQueueCreatedEvent(empireQueue));
            return(Task.FromResult(true));
        }
Exemplo n.º 4
0
 public EmpireQueueDeletedEvent(EmpireQueue empireQueue)
 {
     EmpireQueue = empireQueue;
 }
Exemplo n.º 5
0
 public EmpireQueueUpdatedEvent(EmpireQueue empireQueue)
 {
     EmpireQueue = empireQueue;
 }
        private void StartUpdateEmpireQueueCommand(EmpireQueue empireQueue)
        {
            var updateEmpireQueueCommand = new UpdateEmpireQueueCommand(empireQueue);

            _unitOfWork.SourceEvent(updateEmpireQueueCommand);
        }
 public EmpireQueueCreatedEvent(EmpireQueue empireQueue)
 {
     EmpireQueue = empireQueue;
 }
Exemplo n.º 8
0
 public UpdateEmpireQueueCommand(EmpireQueue empireQueue)
 {
     EmpireQueue = empireQueue;
 }