I use three classes in my library:
public abstract class Base<TFirst, TSecond>
{
public Base()
{
}
}
public abstract class First<TFirstID, TFirstData>
{
public TFirstID ID {get; set;}
public TFirstData Data {get; set;}
}
public abstract class Second<TSecondID, TSecondData>
{
public TSecondID ID {get; set;}
public TSecondData Data {get; set;}
}
How can I indicate that TFirst should inherit from First and TSecond, should inherit from Second, without using common types for ID and Data in Base?
Like this:
public abstract class Base<TFirst, TSecond>
where TFirst : First
...
Edit:
In the First, Second classes, I use TFirstID and TSecondID for the properties. In the Base class, I use these properties.
source
share