我很难发表评论。
这是我的桌子结构:

在我的ViewModel里
// Comments
public ICollection<comments> Comments { get; set; }
// CommentText
public string _CommentText{ get; set; }
// CommentID
public int CommentID { get; set; }
// ParentCommentID
public int ParentCommentID { get; set; }我想加载一个部分视图'_comments.cshtml‘,在这里我显示评论,在那里您可以添加注释。
有人知道我是怎么开始的吗?我不知道该如何表达这些评论。
我可以通过我的存储库获得如下评论:
//COMMENTS
public IQueryable<string> GetComments(int itemID)
{
return from comment in entities.comments
where comment.item_id.Equals(itemID)
select comment.comment_text;
}发布于 2013-06-10 09:04:21
您应该检查comment_parentid字段。如果它是null或0,那么它应该是特定项的父注释。
https://stackoverflow.com/questions/17007695
复制相似问题