I have an existing application which is already developed and is in use.
There are multiple overloads of one of the methods (called Read()) of a class. Now I want t
Have a generic method
public void Read<T>(T t) where t:ISomeCommonInterface
{
Before();
Read(t);
After();
}
You need to use an Interceptor / AoP. The first options that jump to mind are PostSharp and Microsoft Unity.
There's a very good article on this sort of thing in this months MSDN magazine: http://msdn.microsoft.com/en-us/magazine/gg490353.aspx