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

            var engazeEvent = new Evento(command.Id, command.EventoContract);
            await NonEventSourceRepository.InsertAsync(engazeEvent);
        }
Example #2
0
        protected async Task ProcessCommand(UpdateEvento command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var engazeEvent = new Evento(command.Id, command.EventoContract);
            await NonEventSourceRepository.UpdateEvent(engazeEvent);

            await notificationManager.NotifyParticipantsAsync((Notification.EventWithUserIds) command.EventoContract, Engaze.Core.DataContract.OccuredEventType.EventoUpdated);
        }
        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(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(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);
        }
Example #6
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);
        }