tags:

views:

192

answers:

1

I would like a class to implement an interface, I do not want to change the original class (that would add undesired dependecies).

I know I could inherit from the class and make it's child implement these methods, but then I am faced with a problem how to convert the parent class (that come from the data / ORM) to this presentation class.

If I implement all the interface required methods, will it count as being that interface or not ?

+2  A: 

No, it still won't count as implementing the interface.

Extension methods are nothing more than a way of calling static methods in a different kind of way. They don't affect object identity, inheritance etc at all.

Jon Skeet