I'm new to SubSonic (of all flavours), but thought I might as well start with 3.0, because I'd like to use Linq, and I get the impression 3.0 is not that far away from release.
I tried the alpha download .zip, but that seems pretty old and didn't singularize table class names, so I'm now running from the latest trunk SVN version (rev62).
I've run the 'simple' templates, from SubSonic.Templates\Simple against my database and everything seems ok, but the DB context class which the templates create starts like this:
public partial class DB : IQuerySurface
{
static DB _db;
public DB() {
_db = new DB();
}
public static DB CreateDB()
{
if (_db == null)
{
_db = new DB();
_db.Init();
}
return _db;
}
... etc
Unsurprisingly, when I call DB.CreateDB, the ctor recurses endlessly and crashes everything with a stack overflow.
I don't really understand the ctor at all - it doesn't look like it should be there, but both the 'simple' and the 'advanced' templates create something similar, and there's a humongous test suite which I imagine is verifying this somehow.
Clearly I have the wrong end of the stick here - what blindingly obvious point have I missed?
Update: The simple and advanced templates aren't similar, and the advanced ones don't have this problem. Thanks for the help.
Another Update: It looks like this is fixed in the simple templates in SVN r66