示例#1
0
        public IActionResult Index()
        {
            var result = _classifyService.Get()
                         .Select(m => ClassificationViewModel
                                 .Convert(m.Id, m.Content, m.CreationTime, m.ModificationTime));

            return(View(result));
        }
示例#2
0
        public IActionResult Update(int id)
        {
            var blog         = _blogService.Get(id);
            var classifyList = _classService.Get();
            var result       = EditViewModel.Convert(blog.Id, blog.Title, blog.Content, blog.ClassifyId);

            result.ClassifyList = classifyList.Select(m => ClassifyContent.Convert(m.Id, m.Content));
            return(View("_Update", result));
        }
示例#3
0
        public JsonResult Get()
        {
            var result = _classifyService.Get().Select(m => new ClassifyDto
            {
                Id      = m.Id,
                Content = m.Content
            });

            return(Json(result));
        }