은 예입니다. 왜 int를 반복해야합니까? int는 이미 D의 일부이기 때문에.닷넷 C#을 여기에 일반 문제
test1 메서드와 동일합니다. 나는 다음과 같이 쓰고 싶다 : A<D> t = new C()
;
어떻게 할 수 있습니까?
여기보다 현실적인 클래스 이름 UPDATE : 클래스 MyManager에서 온
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>();
}
}
모든 문제. 만약 내가 뭔가를 할 수 있었다면 : MyManager<T> where T : MyModel
그것은 좋을 것이다.
오랫동안 답변 해 주셔서 감사합니다. 이해하는 데 도움이됩니다. 내가하고 싶은 일을 성취하기 위해 할 수있는 해결 방법이 있는지 아십니까? – Melursus