14
私はユーザー名とコメントを表示するためのデータリストを使用し、その下の各コメントのユーザー名を添付します。 私はコメントを表示するためのユーザーコントロールReviewList
とその中にefiles
を持っています。しかし、私はこの行にエラーがあります(s.tblDraft.Comments)。エラーが発生しました:IEnumerableは型引数で使用できません
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();
}
良いもの!また、Resharperのようなツールを使用している場合は、この修正が提案されます。 –