Beispiel #1
0
        public ActionResult GetFreeWay()
        {
            //Initialize
            IFreeWay repos = DataFactory.FreeWayRepository();

            //return radius range Info
            return(Content(JsonConvert.SerializeObject(repos.GetFreeWayInfo()), "application/json"));
        }
Beispiel #2
0
        public List <FreeWayDeserialize> GetFreeWay()
        {
            //Initialize
            IFreeWay repos = DataFactory.FreeWayRepository();

            //return radius range Info
            return(repos.GetFreeWayInfo());
        }
Beispiel #3
0
        public IHttpActionResult GetFreeWay()
        {
            //Initial
            IHttpActionResult responseResult;
            IFreeWay          repos = DataFactory.FreeWayRepository();
            //序列化撈出來的資料
            var jsonSerialize = JsonConvert.SerializeObject(repos.GetFreeWayInfo());
            //做成JSON字串包裝到最後輸出
            StringContent       responseMsgString = new StringContent(jsonSerialize, System.Text.Encoding.UTF8, "application/json");
            HttpResponseMessage responseMsg       = new HttpResponseMessage()
            {
                Content = responseMsgString
            };

            responseResult = ResponseMessage(responseMsg);

            return(responseResult);
        }