// GET api/values
        public List <Hotspot> Get()
        {
            List <Hotspot> hs = new List <Hotspot>();

            hs = GetStats.getAllStats();

            return(hs);
        }
Esempio n. 2
0
        public HttpResponseMessage Get()
        {
            List <Hotspot> hs = new List <Hotspot>();

            hs = GetStats.getAllStats();
            if (hs == null)
            {
                var       message = string.Format("Data Could Not Be Retrieved Please Try Again Later");
                HttpError err     = new HttpError(message);
                return(Request.CreateResponse(HttpStatusCode.NotFound, err));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.OK, hs));
            }
        }