Trying to clean up some old stuff, running into an issue with registering a service with Autofac.
Solution has two implementations of Examine's ISimpleDataService, within which I want to use ctor injection to pass in my dependencies. We use Autofac as our container, and already do plenty of service registration etc with no issue, but am struggling with ISimpleDataService.
Thought something like builder.RegisterType<MyService>().As<ISimpleDataService>() would do the job, but Examine blows up on startup, telling me that Examine.LuceneEngine.Providers.SimpleDataIndexer has no parameterless constructor, which is a common error when Autofac isn't configured correctly.
Has anyone done similar? Not worried about the DI container, just interested in the general registration of the service...
Examine service registration with Autofac
Trying to clean up some old stuff, running into an issue with registering a service with Autofac.
Solution has two implementations of Examine's ISimpleDataService, within which I want to use ctor injection to pass in my dependencies. We use Autofac as our container, and already do plenty of service registration etc with no issue, but am struggling with ISimpleDataService.
Thought something like
builder.RegisterType<MyService>().As<ISimpleDataService>()
would do the job, but Examine blows up on startup, telling me thatExamine.LuceneEngine.Providers.SimpleDataIndexer
has no parameterless constructor, which is a common error when Autofac isn't configured correctly.Has anyone done similar? Not worried about the DI container, just interested in the general registration of the service...
is working on a reply...