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

            hs = GetStats.getStatForProvince(id);

            return(hs);
        }
示例#2
0
        public HttpResponseMessage Get(string id)
        {
            List <Hotspot> hs = new List <Hotspot>();

            hs = GetStats.getStatForProvince(id);

            if (hs == null)
            {
                var       message = string.Format("Hotspot with id = {0} not found", id);
                HttpError err     = new HttpError(message);
                return(Request.CreateResponse(HttpStatusCode.NotFound, err));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.OK, hs));
            }
        }