Пример #1
0
        public Task <bool> Handle(AlterarAppCommand message, CancellationToken cancellationToken)
        {
            #region Basic Validation
            if (!message.IsValid())
            {
                NotifyValidationErrors(message);
                return(Task.FromResult(false));
            }
            #endregion

            #region Others Validations
            var app = _appRepository.ObterPorNome(message.ClienteId, message.Nome);
            if (app != null && app.Nome.ToUpper().Equals(message.Nome.ToUpper()) && !app.Id.Equals(message.Id))
            {
                _bus.RaiseEvent(new DomainNotification(message.MessageType, "Já existe um app com este nome"));
            }
            #endregion

            app = new App(message.Id, message.TipoAppId, message.ClienteId, message.Nome, message.DataCadastro, message.Descrição);

            _appRepository.Update(app);

            if (Commit())
            {
                _bus.RaiseEvent(new AlterarAppEvent());
            }

            return(Task.FromResult(true));
        }
Пример #2
0
 public Task <bool> Handle(AlterarAppCommand request, CancellationToken cancellationToken)
 {
     throw new System.NotImplementedException();
 }