[NonAction]
protected void PrepareNewsCommentModel(NewsCommentModel model, NewsComment newsComment)
{
if (newsComment == null) throw new ArgumentNullException("newsComment");
if (model == null) throw new ArgumentNullException("model");
model.Id = newsComment.Id;
model.CommentTitle = newsComment.CommentTitle;
model.CustomerName = newsComment.CustomerName;
model.CommentText = newsComment.CommentText;
}
public ActionResult Comments(int number)
{
if (!_newsSettings.Enabled)
return RedirectToRoute("HomePage");
var newsComment = _newsService.GetNewsComment(number);
var model = new NewsCommentModel();
PrepareNewsCommentModel(model,newsComment);
return View(model);
}
这是我的错误:
Error 2 Argument 2: cannot convert from
'System.Collections.Generic.IList<Yapi.Core.Domain.News.NewsComment>' to
'Yapi.Core.Domain.News.NewsComment'
D:\YAPI\Projects\ASCS-Portal\Yapi.Web\Controllers\NewsController.cs 420
40
Yapi.Web