2

I need to inject services into WebApi Action Filter (or into DelegatingHandler). With Autofac I can use IAutofacActionFilter (https://code.google.com/p/autofac/wiki/WebApiIntegration). But there isn't Autofac's WebApi Dependecy Resolver in the Orchard. There is Orchard's resolver implementation.

Also I tried this:

var service = (IMyService)GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(IMyService));
or
var service = (IMyService)request.GetDependencyScope().GetService(typeof(IMyService));

But it doesn't work too.

Bertrand Le Roy
  • 17,731
  • 2
  • 27
  • 33
Aries
  • 128
  • 5

0 Answers0