public IActionResult GetAllBranches() { try { return(Ok(branchesLogic.GetAllBranches())); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
public HttpResponseMessage GetAllBranches() { try { List <BranchDTO> branches = logic.GetAllBranches(); return(Request.CreateResponse(HttpStatusCode.OK, branches)); } catch (Exception ex) { return(Request.CreateErrorResponse( HttpStatusCode.InternalServerError, ErrorsManager.GetInnerMessage(ex))); } }