What exactly are we telling the compiler in this line of code ?
public abstract class RepositoryBase<T> where T:class
Are we saying that when we create an object that inherits from RepositoryBase, the object must take a class in the constructor otherwise there will be a compile error ?
It’s saying that when you inherit from
RepositoryBase<T>, the typeTwhich you specify must be some type of class (or interface or etc., but not a value type). For exampleRepositoryBase<int>is illegal and won’t compile: see Constraints on Type Parameters (C# Programming Guide).