Skip to content

Instantly share code, notes, and snippets.

@sharwell
Created January 29, 2014 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharwell/8692708 to your computer and use it in GitHub Desktop.
Save sharwell/8692708 to your computer and use it in GitHub Desktop.
Infinite loop, or clean wrapper?
static class Helper
{
public static T WrapCall<T>(Func<T> func)
{
Console.WriteLine("Calling function");
return func();
}
}
class Foo
{
protected virtual int MethodImpl()
{
return 3;
}
}
class WrappedFoo : Foo
{
protected override int MethodImpl()
{
return Helper.WrapCall(base.MethodImpl);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment