上一节我们实现了分类菜单的界面,本节我们通过webapi接口来传递并写入数据。
定义Web接口
我们先来回顾下之前的webapi接口:
public class api : ControllerBase
{
[HttpGet]
public string Get()
{
List<Model.Category> categories = BAL.Category.query_all();
return Newtonsoft.Json.JsonConvert.SerializeObject(categories);
}
}