I'm working on SolrNet 4.0. There are multicore implementation in Solr. I'm using Autofac as IoC.
var cores = new SolrServers
{
new SolrServerElement
{
Id = "entity1",
DocumentType = typeof(Entity1).AssemblyQualifiedName,
Url = "http://localhost:8983/solr/coreEntity1",
},
new SolrServerElement
{
Id = "entity2",
DocumentType = typeof(Entity2).AssemblyQualifiedName,
Url = "http://localhost:8983/solr/coreEntity2",
},
};
builder.RegisterModule(new SolrNetModule(cores));
var container = builder.Build();
var solrOperations1 =
container.ResolveNamed<ISolrOperations<Entity1>>("entity1");
var solrOperations2 =
container.ResolveNamed<ISolrOperations<Entity2>>("entity2");
above is registration of cores into IoC. But when I resolve from that container, got an error like below.
The requested service 'entity1 (SolrNet.ISolrOperations`1[[Entity1, TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]])' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
Am I doing wrong or missing something in code?
Thanks.