Questions tagged [ninject-interception]

Ninject Interception is a Ninject Extension project which facilitates interception, a design pattern commonly used in Aspect Oriented Programming (AOP). It does this through the use of proxies, namely DynamicProxy implementations of either the Castle or Linfu variety. AOP can be used to reduce or eliminate repetitive lines of code for common cross-cutting concerns, such as logging and error-handling.

Ninject Interception is a Ninject Extension project which facilitates the use of interceptors, a design pattern commonly used in Aspect Oriented Programming (AOP). It does this through the use of proxies, namely DynamicProxy implementations of either the Castle or Linfu variety. AOP can be used to reduce or eliminate repetitive lines of code for common cross-cutting concerns, such as logging and error-handling.

60 questions
3
votes
2 answers

Ninject interception proxying class with non empty constructor via castle dynamic proxy

I am basing most of my current implementation off the information provided here: Ninject Intercept any method with certain attribute? I use a custom planning strategy class which looks for all methods with given attributes (not ninject interceptor…
Grofit
  • 17,693
  • 24
  • 96
  • 176
3
votes
1 answer

Ninject Conventions and Interception

I want to decorate my services with attributes for interception, and then have conventions based binding set the interceptors up for me. I don't want my attributes to inherit from the interception attributes... if I can avoid it. For example, I…
BlakeH
  • 3,354
  • 2
  • 21
  • 31
3
votes
1 answer

can ninject intercept private methods?

I would like to know if its possible for ninject to intercept private methods on my class. im trying to do some aop programming to dynamically inject the logging mechanism.
Ronnel
  • 656
  • 7
  • 9
3
votes
1 answer

Debugging Interceptor pattern

I'm learning to use Interceptor pattern with Ninject. I have an interceptor as follows. public class MyInterceptor:IInterceptor { public void Intercept(IInvocation invocation) { Console.WriteLine("Pre Execute: " +…
Madushan
  • 6,977
  • 31
  • 79
3
votes
1 answer

AOP with Ninject Interception, Castle DynamicProxy and WPF window: Can't find XAML resource in DynamicProxy of window

In our real world application we defined an attribute that is used to enable logging in methods or classes (the usual AOP use case). When we apply this attribute to a WPF window class, objects of this class can't be created by Ninject. Here is a…
Silas
  • 1,140
  • 11
  • 12
2
votes
1 answer

Ninject Interceptors

I'm developing a WPF desktop application with caliburn.micro framework, and I want to configure ninject interceptors so that I can intercept method calls. I would like to do this to handle exceptions in a centralized place, so that I don't have many…
Daniel
  • 2,484
  • 4
  • 27
  • 35
2
votes
1 answer

How to access an extended interface on an interceptor?

We have a multi-binding defined in a NinjectModule for some IInspection interface, like this: private void BindCodeInspectionTypes() { var inspections = Assembly.GetExecutingAssembly() .GetTypes() …
Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
2
votes
1 answer

Why is Ninject Bind with Interception returning an interface proxy?

I'm trying to understand how Ninject.Extensions.Interception 3.0.0.8 is building dynamic proxies for my classes. I've found that when I decorate my concrete classes with an attribute that inherits from InterceptAttribute or when I directly Intercept…
Adolfo Perez
  • 2,834
  • 4
  • 41
  • 61
2
votes
1 answer

AOP Ninject Stop Intercepted Method From Being Called

I'm using Ninject and AOP to do some caching. I have a Attribute that I can apply to any method in my repository and on BeforeInvoke it will return my cached Object if there is one and AfterInvoke create a cached object. This all works great but I…
Joshy
  • 657
  • 8
  • 20
2
votes
0 answers

How to get Ninject Intercept Module hooked up?

I have Ninject, Ninject.Extensions.Interception and Ninject.Extensions.Interception.DynamicProxy installed through NuGet and I have the following module public class InterceptAllModule : InterceptionModule { public override void Load() { …
Ray
  • 12,101
  • 27
  • 95
  • 137
1
vote
1 answer

Couldn't get Ninject-Interception via Attributes to work, what did I do wrong?

I'm trying build out our logging framework using EntLib Logging and use attribute to indicate which class/method should be logged. So I think Interception would be a good choice. I'm a super noob to Ninject and Interception and I's following the…
hwong668
  • 21
  • 4
1
vote
1 answer
1
vote
1 answer

Ninject Interceptors class with parameters

Simple question... I want to use Ninject Interceptors to take care of my NFRs, however alot of my classes require arguments in the constructors. I read that they are looking at allowing constructors with arguments but currently I get an error: Can…
somemvcperson
  • 1,263
  • 2
  • 18
  • 31
1
vote
0 answers

Ninject Interception in WebAPI and parameterless constructor failing

I have an MVC4 site that uses both MVC and WebAPI in it. All was going well till I tried to change my classes to have a cross cutting AOP class that would help with caching data. I am now finding that when I call a method that does not have the…
Ben Haynie
  • 115
  • 9
1
vote
0 answers

Ninject Interception and WCF Extensions, Interceptor Lifetime Management

I've run into an issue with a project I'm working on that is combining the Ninject WCF Extensions with the Interception Extensions. Basically depending on how I setup my configuration, I'm getting some different object lifetime results that are not…