日期:2014-05-17 浏览次数:20403 次
public ActionResult GetNewsList()
{
var newsList = _newsRepository.GetNewsList();
var newsViewList = newsList.Select(news => new NewsViewModel()
{
Id = news.Id,
Title = news.Title,
Content = news.Content,
CategoryName = news.Category.Name,
PublishDate = news.PublishDate.ToString("yyyy-MM-DD HH:mm:ss"),
UpdateDate = news.UpdateDate.ToString("yyyy-MM-DD HH:mm:ss"),
IsActived = news.IsActived ? "是" : "否"
});
return Json(newsViewList, JsonRequestBehavior.AllowGet);
}