Skip to content

Instantly share code, notes, and snippets.

@andreasohlund
Created November 21, 2011 12:10
Show Gist options
  • Select an option

  • Save andreasohlund/1382456 to your computer and use it in GitHub Desktop.

Select an option

Save andreasohlund/1382456 to your computer and use it in GitHub Desktop.
UoW.RavenConfig
var store = new DocumentStore { Url = "http://localhost:8080" };
store.Initialize();
ObjectFactory.Configure(c =>
{
c.For<IDocumentStore>()
.Singleton()
.Use(store);
c.For<IDocumentSession>()
.Use(ctx => ctx.GetInstance<IDocumentStore>()
.OpenSession());
c.For<IManageUnitsOfWork>()
.Use<RavenUnitOfWork>();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment