public IHttpActionResult GetAllRoutes(int page, int pageSize)
 {
     try
     {
         var ruts = new ViewRoutesDTO(service.GetAllRoutes(page, pageSize));
         if (ruts.Routing.Count != 0)
         {
             return(Ok(ruts.Routing));
         }
         return(ResponseMessage(new ResponseMessageService(HttpStatusCode.NotFound, "No invoice categories found.", Request.RequestUri.AbsoluteUri)));
     }
     catch (Exception e)
     {
         return(ExceptionMSG(e));
     }
 }
        public IHttpActionResult GetSearchResults(int PageNum, int PageSize, string Searchtext)
        {
            try
            {
                var search = new ViewRoutesDTO(service.GetSearchedRules(PageNum, PageSize, Searchtext));

                if (search.Routing.Count != 0)
                {
                    return(Ok(search.Routing));
                }
                return(ResponseMessage(new ResponseMessageService(HttpStatusCode.NotFound, "No rules found.", Request.RequestUri.AbsoluteUri)));
            }
            catch (Exception e)
            {
                return(ExceptionMSG(e));
            }
        }