Considering the following setup, how can I restrain IConnection
to only contain IPort
of the same ConnectionType
in Ports
? Maybe I am overlooking something obvious here:
Enum ConnectionType
{
Undefined,
Type1,
Type2
}
IConnection
{
ConnectionType ConnectionType {get;set}
IEnumerable<IPort> Ports {get;set;}
}
IPort
{
ConnectionType ConnectionType {get;set;}
}