You can’t do this automatically in C# – you should probably be looking at AOP, e.g. with PostSharp.
More Related Contents:
- Check if a class is derived from a generic class
- Loading DLLs at runtime in C#
- How do I intercept a method call in C#?
- Testing if object is of generic type in C#
- How do I invoke an extension method using reflection?
- How does WCF deserialization instantiate objects without calling a constructor?
- Get property name and type using lambda expression
- How to call generic method with a given Type object? [duplicate]
- How do I get the member to which my custom attribute was applied?
- Getting a System.Type from type’s partial name
- How to get a property value using reflection
- How To Test if a Type is Anonymous? [duplicate]
- How to find all the classes which implement a given interface?
- Programmatically get Summary comments at runtime
- Why GetType returns System.Int32 instead of Nullable? [duplicate]
- Change custom attribute’s parameter at runtime
- Getting Nested Object Property Value Using Reflection
- How to get MethodInfo of interface method, having implementing MethodInfo of class method?
- Why do some C# lambda expressions compile to static methods?
- Why is there not a `fieldof` or `methodof` operator in C#? [closed]
- Can C# Attributes access the Target Class?
- How to use local variable as a type? Compiler says “it is a variable but is used like a type”
- Finding all classes with a particular attribute
- How do I check if a type provides a parameterless constructor?
- How can I tell if a C# method is async/await via reflection?
- how to get both fields and properties in single call via reflection?
- How can I write a generic container class that implements a given interface in C#?
- How to get defined operators for a type in .net
- Find methods that have custom attribute using reflection
- Why is the use of reflection in .NET recommended?