public IHttpActionResult Update(EmitenteUpdateCommand emitente)
        {
            var validator = emitente.Validar();

            if (!validator.IsValid)
            {
                return(HandleValidationFailure(validator.Errors));
            }
            return(HandleCallback(() => _emitenteService.Update(emitente)));
        }
Example #2
0
        public bool Update(EmitenteUpdateCommand emitente)
        {
            var _emitente = _repository.GetById(emitente.Id);

            if (_emitente == null)
            {
                throw new NotFoundException();
            }

            var updateEmitente = Mapper.Map(emitente, _emitente);

            return(_repository.Update(updateEmitente));
        }