Here is an example :
public class B<T> {}
public class D : B<int> {}
public class A<T, S> where T : B<S> {}
public class C : A<D, int> {}
public class Test1
{
public class test1
{
A<D, int> t = new C();
}
}
What I would like do to is in declaring class C, only say : C : A<D>
. Why I need to repeat int ? Because int is already a part of D.
Same in the test1 method. I would like to write : A<D> t = new C()
;
How, can I achieve that ?
UPDATE
Here with more realistic class names :
public class MyModel<T> { }
public class MyTrueModel : MyModel<int> { }
public class MyManager<T,S> where T : MyModel<S> { }
public class MyTrueManager : MyManager<MyTrueModel, int> { }
public class Test1
{
public class test1
{
MyManager<MyTrueModel, int> t = new MyManager<MyTrueModel, int>();
}
}
All the problem come from the class MyManager. If I was able to do something like : MyManager<T> where T : MyModel
it'd would be great.