I need to create a DAL and repositories using petapoco. The difficulty that comes in, is that I dont know how it manages its connections.
If I was using dapper I know how the connection process flows because I control it. I don't know what are the best practices in creating a DAL with petapoco.
public class UserRepository
{
public IEnumerable<User> All()
{
var db = new PetaPoco.Database("Sqlite_Connection");//this line
var s = db.Query<User>("SELECT * FROM Users");
return s.ToList();
}
}
I would like to place var db = new PetaPoco.Database("Sqlite_Connection");//this line
in my DALHelper class as a static property but I'm worried about scalability