mehdime / DbContextScope

A simple and flexible way to manage your Entity Framework DbContext instances
http://mehdi.me/ambient-dbcontext-in-ef6/
MIT License
634 stars 271 forks source link

Conflict with Ninject interception? #44

Open amelumad opened 8 years ago

amelumad commented 8 years ago

Hello,

I have been using DbContextScope for a while in my project but started to have an issue recently. I have added Ninject interceptor in order to do dome basic logging in my Service layer classes. Here is an example of module configuration:

Bind<IClientFileService>().To<ClientFileService>().InRequestScope().Intercept().With<LogErrorInterceptor>();

Once that change got introduced I started to receive "Non-static method requires a target" exception on DbContextScope.SaveChangesAsync invocation (the stack trace is attached).

What could I do to be able to use these two functions together?

Thanks, Anton

StackTrace.txt