我想使用数据列表来显示用户名下方的每个评论的用户名及其评论和附件。
我有一个ReviewList
用于显示评论的用户控件efiles
。但我在这一行(s.tblDraft.Comments)有错误,下面有一个错误:
The non-generic type 'System.Collections.IEnumerable' cannot be used with type arguments
请帮忙。问题是什么?
private void Displayuser()
{
var reviews =
(from s in _DataContext.tblSends
from u in _DataContext.Users
where (s.DraftId == _Draftid) && (s.ToEmailId == u.ID)
orderby u.Name
select new
{
userid = u.ID,
username = u.Name,
comments =s.tblDraft.Comments,
w = s.tblDraft.Comments.SelectMany(q => q.CommentAttaches)
}).Distinct();
DataList1.DataSource = reviews;
DataList1.DataBind();
var theReview = reviews.Single();
DisplayReviews(theReview.comments, theReview.w);
}
private void DisplayReviews(IEnumerable<Comment> comments,
IEnumerable<CommentAttach> w)
{
ReviewList reviewList = (ReviewList)DataList1.FindControl("ReviewList1");
reviewList.Comments = comments;
reviewList.CommentAttachs = w;
reviewList.DataBind();
}