score:2

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);

score:0

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 http://automapper.codeplex.com/

or

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

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


Related Query

More Query from same tag