Accepted answer

you could always bypass it by changing the code into this:

var q = (
   from c in db.tblcomments 
   where c.categoryid == category && c.identifierid == identifier 
   orderby c.postdate descending select c
.skip(toskip > 0 ? toskip : 0)
.take(totake > 0 ? totake : int.maxvalue);


use the same logic as chrisf showed and finish the statement with return q.toarray() or if you need a model class e.g. comment then use something like automapper


return x=>  new comment{name =, description = x.description}).toarray();

note: the toarray or tolist() will cause the query to be executed.

Related Query

More Query from same tag