function decorators in c#
The way I achieve this is through AOP frameworks like Castle Dynamic Proxy, Spring.NET or even the Policy Injection Application Block.
you can sort of achieve that by "ContextBoundObject" in the .NET framework.but it's a bit convoluted because it basically uses .net remoting infrastructure to intercept method calls. (the runtime overhead is minimum if your calls are within the same app domain but just across different "context").so the better approaches would be the ones mentioned above by the other posters.