Skip to content

Instantly share code, notes, and snippets.

@schotime
Created May 18, 2011 00:13
Show Gist options
  • Save schotime/977737 to your computer and use it in GitHub Desktop.
Save schotime/977737 to your computer and use it in GitHub Desktop.
PetaPoco StructureMap
//This is how I use PetaPoco with structure map but I'm also using the IDatabase interface from my branch at http://github.com/schotime/petapoco
public class PetaPocoRegistry : Registry
{
public PetaPocoRegistry()
{
Scan(x =>
{
x.TheCallingAssembly();
x.WithDefaultConventions();
});
For<IDatabase>().HttpContextScoped().Use(GetDatabase);
}
public static IDatabase GetDatabase()
{
return new MyDb("Peta");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment