I think I could be using this wrong, there wasn't much on the Ninject variant of multiple cores, but I'm trying to use Ninject and SolrNet. While taking advantage of fully loose mapping. So I know I need to use Ninject named bindings. Can't use Windsor, it's dll's don't seem to play well with our current stuff.
Suspect code:
SolrServers cores = new SolrServers();
cores.Add(new SolrServerElement
{
Id = "index1",
DocumentType = typeof(ISolrOperations<Dictionary<string, object>>).AssemblyQualifiedName,
Url = "http://localhost:8080/solr/index1",
});
cores.Add(new SolrServerElement
{
Id = "index2",
DocumentType = typeof(ISolrOperations<Dictionary<string, object>>).AssemblyQualifiedName,
Url = "http://localhost:8080/solr/index2",
});
var kernal = new StandardKernel(new SolrNetModule(cores));
var operations = kernal.Get<ISolrOperations<Dictionary<string, object>>>("index1");
Error Produced:
Test 'Test.DifferentTest' failed:
Ninject.ActivationException : Error activating ISolrOperations{Dictionary{string, Object}}
No matching bindings are available, and the type is not self-bindable.
Activation path:
1) Request for ISolrOperations{Dictionary{string, Object}}
I understand the concept of DI, however I don't know much more than that because in MVC everything seemed hidden from me. So any additional explanation, on why this is dumb/how SolrNet interacts with it, would be appreciated.
Link to SolrNet Module https://github.com/mausch/SolrNet/blob/master/Ninject.Integration.SolrNet/SolrNetModule.cs