Jeśli zrobiłem interfejs z klauzulą where:
public interface IClass1<T> where T : class
{
void Insert(T param);
}
to dlaczego do klasy implementującej ten interfejs muszę też dodać klauzulę where:
public class Class1<T> : IClass1<T> where T : class
{
public virtual void Insert(T param)
{
//......
}
}
bo jak nie dodam to mam błąd:
**The type 'T' must be a reference type in order to use it as parameter 'T' in the generic type or method 'ClassLibrary1.IClass1<T>' **
Wydaje mi się, że skoro mam interfejs z klauzulą where gdzie jest wskazane, że T ma być klasą to w klasie implementującej ten interfejs już nie powinno się wskazywać, że T ma być klasą, bo przecież to jest wskazane w interfejsie.