Created
January 12, 2019 16:44
Star
You must be signed in to star a gist
This file contains 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