Hi,
I have a question about .net generics. Consider the following code:
public abstract class Test<TKey>
{
TKey Key { get; set; }
}
public class Wrapper<TValue, TKey>
where TValue : Test<TKey>
{
public TValue Value { get; set; }
}
Now, when using this code, I could do something like this:
Wrapper<Test<int>, int> wrapper = new Wrapper<Test<int>, int>();
The int type parameter has to be provided twice. Is it possible to modify the Wrapper definition, to require TValue to be a generic type, and use this 'nested' generic type parameter insted of the TKey type parameter?