Using StructureMap with SolrNet

SolrNet is a great .NET library for querying and updating a Solr instance. I’ve been using it recently as part of a project in which we were using StructureMap as our IOC framework (like most of our projects). It has its own built in IOC  based on the Common Service Locator Interface (Microsoft.Practices.ServiceLocation) as well as support for Windsor and Ninject.

As I didn’t want to switch our IOC Framework I decided to write a registry class. It’s now very simple to register  the container using the following line in your bootstrapper.

ObjectFactory.Initialize(
x => x.AddRegistry(
new SolrNetRegistry("http://localhost:8893/solr")
)
);

Its now included in the git master and the binaries should be available shortly.

Updated: The structuremap adapter now allows for multicore configuration

Advertisements

2 Comments on “Using StructureMap with SolrNet”

  1. I’m planning to release soon, but in the meantime there are binaries available from the build server (artifacts in http://teamcity.codebetter.com/viewType.html?buildTypeId=bt155&tab=buildTypeStatusDiv&guest=1 )

  2. Jason says:

    Neat stuff, thanks!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s