C#后台list转化为json格式

public ActionResult GetData()

{

var lst = new List<Model.calendarevent>();

lst.Add(new Model.calendarevent

{

allDay = true,

confid = 1,

confname = "工作",

confshortname = "M1",

description = "",

end = "2018-12-14 08:30:00",

start = "2018-12-14 08:00:00",

fullname = "开会",

id = 1,

noteType = 1,

sid = 2,

title = "记事簿",

topic = "记事簿",

uid = 3

});

return Json(lst, JsonRequestBehavior.AllowGet);

}

写一个model,直接把需要字段添加到model里面,返回这个就行