Skip to content

Instantly share code, notes, and snippets.

@mizrael
Created January 12, 2019 16:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mizrael/bd5b1c882f7be08a696391f2d6312e14 to your computer and use it in GitHub Desktop.
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