Created
January 12, 2019 16:44
-
-
Save mizrael/bd5b1c882f7be08a696391f2d6312e14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IFoo{ | |
void Bar(); | |
} | |
public class Foo : IFoo{ | |
public Bar(){ | |
// whatever... | |
} | |
} | |
public class DecoratedFoo : IFoo{ | |
private readonly IFoo _inner; | |
public DecoratedFoo(IFoo inner){ | |
_inner = inner; | |
} | |
public Bar(){ | |
// you can do something here... | |
_inner.Bar(); | |
// ...and guess what, here as well! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment