Skip to content
Interception extension for Ninject
C#
Branch: master
Clone or download

Latest commit

Latest commit 5492b30 Feb 9, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Add the missing using statement Feb 9, 2020
.gitignore
CHANGELOG.md
LICENSE.txt
Ninject.Extensions.Interception.sln
README.md
appveyor.yml

README.md

Ninject.Extensions.Interception

Build status codecov NuGet Version NuGet Download

This extension adds support for interception to Ninject.

For example, the WCF client proxy can be intercepted as below.

[ServiceContract]
public interface IFooService
{
    [OperationContract]
    void Foodo();
}

var interceptor =
    new ActionInterceptor(
        invocation => Console.WriteLine($"Executing {invocation.Request.Method}."));

kernel.Bind<IFooService>()
    .ToMethod(context => ChannelFactory<IFooService>.CreateChannel("*"))
    .Intercept(typeof(ICommunicationObject))
    .With(interceptor);
You can’t perform that action at this time.