You limit your general parameter T to a class in your implementation. You do not have this limitation for your interface.
You need to remove it from your class or add it to your interface in order to compile the code:
Since you call the CreateObjectSet<T>() method, which requires a class constraint , you need to add it to your interface.
public interface IMyClass { int GetCount<T>(string filter) where T : class; }
Wouter de kort
source share