WebAPI返回一个List

来源:互联网 发布:奚梦瑶 知乎 编辑:程序博客网 时间:2024/05/19 12:18

前端:

        [AllowAnonymous]        [HttpGet]        public void Test20171218(string myPara) {            var client = MyClient.Create();            var resp = client.GetAsync("MyUrl?myPara="+myPara).Result;            var result = resp.Content.ReadAsStringAsync().Result;            List<MyRecord> data = MyJsonHelper.Deserialize<List<MyRecord>>(result);        }


后端:
       /// <summary>        /// 获取MyRecord集合        /// </summary>        /// <param name="myPara"></param>        /// <returns></returns>        [HttpGet]        public List<SignRecordDoc> GetMyRecordDocLst(string myPara) {            return this.MyRecordService.GetMyRecordDocLst(myPara);        }



原创粉丝点击