public bool Update(AddresseeUpdateCommand command) { var addressee = _repository.GetById(command.Id); if (addressee == null) { throw new NotFoundException(); } Mapper.Map(command, addressee); return(_repository.Update(addressee)); }
public IHttpActionResult Update(AddresseeUpdateCommand command) { var validador = command.Validate(); if (!validador.IsValid) { return(HandleValidationFailure(validador.Errors)); } return(HandleCallback(_service.Update(command))); }
public static AddresseeUpdateCommand AddresseeCommandToUpdate() { AddresseeUpdateCommand addressee = new AddresseeUpdateCommand(); addressee.Id = 1; addressee.BusinessName = "NDDIGITAL"; addressee.CorporateName = "NDDIGITAL S/A - SOFTWARE"; addressee.Cnpj = "12.345.678/0009-09"; addressee.StateRegistration = "12.234.5678-9"; addressee.Address = AddressCommandToRegister(); return(addressee); }