Created
May 18, 2011 00:13
-
-
Save schotime/977737 to your computer and use it in GitHub Desktop.
PetaPoco StructureMap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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