public IActionResult GetCode(int code) { try { var codeR = codeService.GetByCode(code); if (codeR == null) { return NotFound(); } return Ok(codeR); } catch (Exception) { return BadRequest(); } }