While KeyValuePair returns nothing technically wrong, the thing you return is conceptually not a key-value. This is a simple couple.
Alternatively, you can use Tuple , which is available in .NET 4.0, or in the meantime, declare your own structure .
I usually recommend out options for returned tuples. Specially, when you use LINQ and functional language constructors, working with out parameters is tedious.
Mehrdad afshari
source share