Nhib.pdfTo support the Web, specific configuration is required.CodeThe generation tool cannot generate configuration files that directly support the web.
/// <Summary>Configure the initialization encapsulation </Summary>
Public class databasestarter: activerecordstarter
{
Static type [] types = new system. Type [] {
Typeof (NE ),
Typeof (new.port ),
Typeof (city ),
Typeof (vendor ),
Typeof (netelementtype ),
Typeof (nevirtualport ),
Typeof (role ),
Typeof (functionoperation ),
Typeof (commandset ),
Typeof (resourcegroup ),
Typeof (command ),
Typeof (roleuser ),
Typeof (roleusergroup ),
Typeof (roleresoperation ),
Typeof (rolerescommandset ),
Typeof (resourceoperation ),
Typeof (systemconfig )};
Static bool isinitialized;
/// <Summary> initialize database connection configuration. </Summary>
Public static void initialize (string connectionstring)
{
If (databasestarter. isinitialized = false)
{
Lock (databasestarter. types)
{
stringreader reader = new stringreader (string. format (" ", connectionstring);
Xmlconfigurationsource src = new xmlconfigurationsource (Reader );
Activerecordstarter. initialize (SRC, databasestarter. types );
Databasestarter. isinitialized = true;
}
}
}
}