Doesn't make a lot of sense, but
public interface ICommand<T1, T2>
{
T1 PropA { get; set; }
T2 PropB { get; set; }
}
public interface IBaseStuff
{
int PropD { get; set; }
}
public interface IMyBaseStuff<T>
{
T PropC { get; set; }
}
public class MyGenericCommand<T> : ICommand<T, T> where T : IMyBaseStuff<IBaseStuff>
{
public T PropA { get; set; }
public T PropB { get; set; }
}
public class BaseStuff : IBaseStuff
{
public int PropD {get;set;}
}
public class MyCommandClass : IMyBaseStuff<IBaseStuff>
{
public IBaseStuff PropC {get; set;}
}
Usage
MyGenericCommand<MyCommandClass> _command = new MyGenericCommand<MyCommandClass>();
_command.PropA = new MyCommandClass();
_command.PropB = new MyCommandClass();
_command.PropA.PropC = new BaseStuff();
_command.PropA.PropC.PropD = 123;