示例#1
0
        public ActionResult GetUBikeInfo()
        {
            //Initial Variables
            IUBike repos = DataFactory.UBikeRepository();

            return(Content(JsonConvert.SerializeObject(repos.GetUbikeInfo()), "application/json"));
        }
示例#2
0
        public List <UBikeDeserialize> GetUBike()
        {
            //Initial Variables
            IUBike repos = DataFactory.UBikeRepository();

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

            responseResult = ResponseMessage(responseMsg);

            return(responseResult);
        }