Start by reading the Quick start guide
To connect to your db, you can start with the samples given:
// Normal
var db = new PetaPoco.Database("connectionStringName");
// Or the fluent configuration (PostgreSQL as an example)
var db = DatabaseConfiguration.Build()
.UsingConnectionString("Host=127.0.0.1;Username=petapoco;Password=petapoco;Database=petapoco;Port=5001")
.UsingProvider<PostgreSQLDatabaseProvider>()
.UsingDefaultMapper<ConventionMapper>(m =>
{
m.InflectTableName = (inflector, s) => inflector.Pluralise(inflector.Underscore(s));
m.InflectColumnName = (inflector, s) => inflector.Underscore(s);
})
.Create();
V6 only change the package and dropped support for some thing like T4, but you don't need the templates to start. The rest it's the same as V5
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…