views:

122

answers:

1

I am really baffled on this one. I am trying to pass my posts vaiable to a method. How do I go about doing this:

var posts = from p in context.post
            where (p.post_isdeleted == false && (object.Equals(p.post_parentid, null))
            select new
            {
                p.post_date,
                p.post_id,
                FavoriteCount = (from f in context.favorites
                                 where f.post.post_id == p.post_id
                                 select new { f }).Count()
            };


posts = QuestionList.FilterQuestion(posts, sort);

//the problem is here
//IQueryable is not the right type for posts. What type do I put in there
private static IQueryable FilterQuestion(IQueryable p, string sort)
{
+2  A: 
private static IQueryable<post> FilterQuestion(IQueryable<post> p, string sort)
Luhmann