We have legacy code and want to know when application call 'Execute' method.
Legacy code structure:
public class CmsJob
{
public static string Execute()
{
}
}
Is it possible to use IInterceptor or PostSharp.dll to implement additional operation after or before execution static method?
It is possible to intercept the static method with PostSharp, even if it's declared in an external assembly that you can't modify. You can implement your own OnMethodBoundaryAspect.
Then apply this aspect in your project on the assembly level and set these properties: AttributeTargetAssemblies, AttributeTargetTypes, AttributeTargetMembers.