Is it possible to have a general constraint that is an unlimited common type?
For instance:
public T DoSomething<T>(T dictionary) where T : IDictionary<,>
{
...
}
Edit: To explain the context, I want to limit the use of the method in an IDictionary, but for the method itself it does not matter what TKey and TValue are.
source
share