C# - Dynamic Keyword and Interface Implementations

Posted by Adam Driscoll on Stack Overflow See other posts from Stack Overflow or by Adam Driscoll
Published on 2010-05-05T03:48:20Z Indexed on 2010/05/05 4:08 UTC
Read the original article Hit count: 352

I'm assuming this isn't possible but before digging further is there a way to do something like this:

public void ProcessInterface(ISomeInterface obj) {}

//...

dynamic myDyn = GetDynamic<ISomeInterface>() 
ProcessInterface(myDyn);

I've seen a post arguing for it but it sounds like it wasn't included.

A little context: .Net assembly exposed through COM -> Silverlight app consuming interface-implementing classes. Would be nice to refer to the objects by interface. I really don't expect that this was what was intended...

© Stack Overflow or respective owner

Related posts about c#

Related posts about .net-4.0