I have been moving in circles for the last few hours trying to integrate Autofac and ASP.NET Web API 2 Application. I have been following the Autofac and and its wiki at Integrating with ASP.NET Web API.
But clearly, this wiki is outdated for Web API 2. Does anyone have a way i could configure my application to work with Autofac? I am just about giving up and going back to Ninject.
I have installed Autofac, Autofac.WebApi2 and Autofac.Mvc5
I can't call the following
containerBuilder.RegisterApiControllers(Assembly.GetExecutingAssembly());
.InstancePerApiRequest(); not reachable. In fact, anything i try to call with Api in the name is not defined. (Such as RegisterApiControllers, AsWebApiActionFilterFor, RegisterWebApiFilterProvider, InstancePerApiRequest, InstancePerApiControllerType)
Also, i am trying to use Log4Net and i have implemented the Module as per wiki, now in the LoggingActionFilter shown in the wiki, what do i replace this line with as Log4Net does not contain a definition for Write
_logger.Write(actionContext.ActionDescriptor.ActionName);