我在我的控制器中调用以下方法。
var comments = _blogService.GetBlogComments(bc.CommentParentID);//Controller code
班级代码:
public virtual IList<BlogComment> GetBlogComments(int CommentParentId)
{
if (CommentParentId != 0)
{
var query = from bc in _blogCommentRepository.Table
where bc.CommentParentID == CommentParentId
select bc;
var comments = query.ToList();
return comments;
}
else
return null;
}
我收到错误
var query = from bc in _blogCommentRepository.Table
where bc.CommentParentID == CommentParentId
select bc;][1]