public async Task <IActionResult> DiscontinueBrand(int id) { DataResponse response = new DataResponse(); try { var brand = await _brandService.GetById(id); if (brand == null) { response.Message = "The brand is not found."; return(NotFound(response)); } await _brandService.Discontinue(brand); response.Success = 1; response.Message = "The brand has been discontinued"; return(Ok(response)); } catch (Exception ex) { response.Message = ex.Message; return(StatusCode(500, response)); } }