public HttpResponseMessage Get()
        {
            List <BranchModel> branchesList = BranchManager.GetAllBranches();

            return(new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new ObjectContent <List <BranchModel> >(branchesList, new JsonMediaTypeFormatter())
            });
        }
Exemple #2
0
 [Route("all")]   // access link : http://localhost:53093/api/order/orders
 public HttpResponseMessage GetAllBranches()
 {
     using (logic = new BranchManager())
     {
         try
         {
             List <BranchModel> branches = logic.GetAllBranches();
             return(Request.CreateResponse(HttpStatusCode.OK, branches));
         }
         catch (Exception ex)
         {
             return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ExceptionHelper.GetInnerMessage(ex)));
         }
     }
 }
Exemple #3
0
 public IActionResult GetAllBranches()
 {
     return(Ok(manager.GetAllBranches()));
 }