Created
December 17, 2012 20:30
-
-
Save anonymous/4321894 to your computer and use it in GitHub Desktop.
Creando clases con Interceptores
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Generator.CreateClassProxy<ServicioWeb>(new ErrorLoggingInterceptor()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ErrorLoggingInterceptor : IInterceptor | |
| { | |
| public void Intercept(IInvocation invocation) | |
| { | |
| try | |
| { | |
| invocation.Proceed(); | |
| } | |
| catch (Exception exception) | |
| { | |
| // loggear | |
| throw exception; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment