public async Task <IActionResult> List(string searchstring, int category, int pageindex = 1, int status = -1, int type = 0) { var VM = new ContentListViewModel(); VM.searchstring = searchstring; VM.category = category; VM.pageindex = pageindex; VM.status = status; if (type == 0) { //文章类型才获取分类 VM.metas = await mms.GetMetasAsync(0); } VM.type = type; VM.contents = await cms.GetContentsAsync(status, searchstring, category, pageindex, 10, type); return(View(VM)); }
public async Task <IActionResult> Index() { var VM = new IndexViewModel(); VM.metas = await mms.GetMetasAsync(-1); ViewData.Model = VM; return(View()); }