Hacker News new | ask | show | jobs
by agbell 5890 days ago
How can I use this structural typing feature?

AOP weavers like postsharp let you do some duck typing like stuff by injecting interfaces as post compile step.

2 comments

You could use Reflection to search for types based on structure. But there is no syntax for it.

Actually Linq + Reflection is some of the most entertaining code to write C#. Example: http://github.com/ecoffey/Bebop/blob/master/Bebop/BebopAppli...

we're saying there "Give me all the types out of a specific assembly that implement IResource".

You could try reflection and/or dynamic. The latter requires .Net 4.