I was wondering if there is anyway to down cast a generic interface?
What I whant to do is something like this, I have an interface like this
T GetValue ();
and in code I would like some generic code to do something like this:
MyStringClass : MyInterface<string>
MyStringClass sc = new MyStringClass () ;
if (sc is MyInterface<object>)
MyInterface<object> dc = (MyInterface<object> )sc ;
object o = dc.GetValue () ;
I'm pretty sure that I can't do this and it would be best to add a second non generic interface that does the cast for me.