In C#, one can define a class/method/function with multiple type parameters. For example,
// function
void foo<T1, T2>(T1 x, T2 y) { /*body*/}
// class
class Bar<T1, T2> { /*body*/ }
I understand how to use it, but I don't understand why I need it. So I'm hoping someone can answer the following questions:
1) What is the use case for multiple type parameters?
2) Based on the use case given in Question 1, what are the alternative solutions for that use case if multiple type parameters is not a feature of the language in use?