public ActionResult GetUBikeInfo() { //Initial Variables IUBike repos = DataFactory.UBikeRepository(); return(Content(JsonConvert.SerializeObject(repos.GetUbikeInfo()), "application/json")); }
public List <UBikeDeserialize> GetUBike() { //Initial Variables IUBike repos = DataFactory.UBikeRepository(); return(repos.GetUbikeInfo()); }
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); }