I have a generic method something like:
public abstract T method<T>(int arg) where T : class, new();
Then I implement it in the child class
public MyType method<MyType>(int arg){
MyType e = new MyType();
e.doStuff (arg); // ERROR HERE
return s;
}
But I can’t access MyType’s members… How come ? Is there something I can add to enable them or something ?
Thank you
Miloud
You can do like this (note that I have moved some of your generic parameters and constraints around).