示例#1
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);
        }
示例#2
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);
        }