Skip to content

Instantly share code, notes, and snippets.

@ronnieoverby
Created April 19, 2012 01:51
Show Gist options
  • Save ronnieoverby/2417818 to your computer and use it in GitHub Desktop.
Save ronnieoverby/2417818 to your computer and use it in GitHub Desktop.
public class MyDocStoreCreator : ICreateDocumentStore
{
public IDocumentStore CreateDocumentStore(ConnectionInfo connectionInfo)
{
var ds = new DocumentStore
{
Url = connectionInfo.Url
};
try
{
ds.Initialize();
IndexCreation.CreateIndexes(GetType().Assembly, ds);
return ds;
}
catch (System.Exception)
{
ds.Dispose();
throw;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment