protected async Task ProcessCommand(DeleteEvento command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var evento = (await NonEventSourceRepository.GetEvent(command.Id)).ToDomainEvent();

            evento.DeleteEvent();
            await NonEventSourceRepository.DeleteAsync(evento.Id);
        }
        protected async Task ProcessCommand(UpdateParticipantList command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var evento = (await NonEventSourceRepository.GetEvent(command.Id)).ToDomainEvent();

            evento.UpdateParticipantList(command.ParticipantList);
            await NonEventSourceRepository.SaveEvent(evento);
        }
        protected async Task ProcessCommand(ExtendEvento command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var evento = (await NonEventSourceRepository.GetEvent(command.Id)).ToDomainEvent();

            evento.ExtendEvento(command.ExtendedTime);
            await NonEventSourceRepository.UpdateEventEndDate(evento.Id, evento.EndTime);
        }
示例#4
0
        protected async Task ProcessCommand(LeaveEvento command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var evento = (await NonEventSourceRepository.GetEvent(command.Id)).ToDomainEvent();

            evento.LeaveEvento(command.ParticipantId);
            await NonEventSourceRepository.UpdateEvent(evento, true);

            await notificationManager.NotifyParticipantsAsync((Notification.EventWithUserIds) evento.ToDataContractEvent(), Engaze.Core.DataContract.OccuredEventType.ParticipantLeft);
        }