Tutorial by Examples

Interceptors require the IInterceptor interface. Any public method within the intercepted class will be intercepted (including getters and setters) public class MyInterceptor : IInterceptor { public void Intercept(IInvocation invocation) { //Calls the next method in the chain - T...
Interceptors are a good tool for implementing cross-cutting concerns such as logging or authentication. Let's say we have a following service: public interface IService { string CreateOrder(NetworkCredential credentials, Order orderToCreate); string DeleteOrder(NetworkCredential credenti...
For registration like this: var container = new WindsorContainer(); container.Register( Component.For<FirstInterceptor>(), Component.For<SecondInterceptor>(), Component.For<ThirdInterceptor>(), Component.For<IService>() .ImplementedBy<Servi...
Interceptors are registered like regular components in Windsor. Like other components, they can depend on another components. With following service for validating credentials: public interface ICredentialsVerifier { bool IsAuthorizedForService(NetworkCredential credentials); } public cl...

Page 1 of 1