What's the best way to return total item count from a repository getitems method

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-05-04T14:30:24Z Indexed on 2010/05/04 18:18 UTC
Read the original article Hit count: 145

Filed under:
|
|

We've got the following repository method

public IList<Foo> GetItems(int fooId, int pageIndex, int pageSize
, string sortField, string sortDir, out int totalItems)
{
// Some code
}

My question is: is it ok to use out in this way. I'm somewhat uncomfortable with out, but can't come up with a better way to write this as a single call.

© Stack Overflow or respective owner

Related posts about repository

Related posts about parameter