I came across some code (created by a code generation wizard, not a person) that looks like this:
public class xxxViewModel<T> : SomeBaseClass<T> where T : xxx
So xxx is really a class, and only one concrete class. I'm not sure why developers would do this, and not:
public xxxViewModel : SomeBaseClass<xxx>
The class (xxxViewModel <T>) is not used as a general class - it allows only T to be one type of class - xxx, and it does not have counters, so the actual type of the class does not matter as it would be in the list <T>.
What is the reason for defining a general class, where T can only be a specific class?
source
share