public ActionResult RemoveCompany(int id) { try { var company = _companyAppService.GetCompanyById(id); if (company == null) { AdicionarErroProcessamento("Não foi possível localizar a empresa pelo id informado."); return(CustomResponse()); } _companyAppService.RemoveCompany(company); return(CustomResponse()); } catch (Exception ex) { MessageException(); return(CustomExceptionResponse()); } }
public virtual IActionResult GetCompanyById([FromRoute] int id) { try { var companyCommand = _companyAppService.GetCompanyById(id); return(ReturnResponse(companyCommand, companyCommand, null)); } catch (Exception e) { return(BadRequest("Error: " + e.Message)); } }