Imagine that I have a generic base class like this:
public abstract class AnimalDTO<TA, TB>
{
public static TB ToDTO(TA entity)
{
return ConvertToDTO<TB>(entity);
}
}
The class is responsible for being able to convert a passed-in entity to a DTO.
I have a class that uses this generic class:
public class MammalDTO<Mammal, MammalDTO>
{
// omitted stuff here
}
A user can now use MammalDTO.ToDTO(mammal)
to convert a Mammal
to a MammalDTO
.
Now I want to derive off Mammal:
public class Koala<???, ???> : Mammal<???, ???>
How do I do this?