1

in a custom method attribute is there is any way to access the method and execute some code before the method body ? and at the end of the method body ?

thanks in advance.

1
  • 1
    Would only be possible with AOP. Commented Jul 4, 2011 at 13:18

1 Answer 1

1

The keyword to look for is Aspect oriented programming (AOP). One implementation that can be used to do what you want is PostSharp.

Sign up to request clarification or add additional context in comments.

2 Comments

i know the OnMethodBoundaryAspect of PostSharp but postsharp is too much to put in my application plus its not free and complicated , i was trying to make my own simple attribute which will allow me to log entry of a method and the out of it.
any other solution (AOP) which free ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.