Let's say I have two interfaces, IOne and ITwo, and I want some other class to have a class property that subscribes to both. Is the best approach:
1.
public class MyClass<T> where T : IOne, ITwo
{
public T MyProperty { get; set; }
}
2.
interface IOneAndTwo : IOne, ITwo
{
}
public class MyClass
{
public IOneAndTwo MyProperty { get; set; }
}
3. Something else.
I'm not positive that #2 will work, but I think so. The idea is to accomplish something like the following:
public class MyOtherClass : IOne, ITwo
{
// stuff
}
MyClass myClass = new MyClass();
MyOtherClass myOtherClass = new MyOtherClass();
myClass.MyProperty = myOtherClass
Thoughts?
Without order nothing can exist - without chaos nothing can evolve.