Task performer syntax change

Posts   
 
    
rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 28-Jul-2010 02:30:28   

Hello,

I am trying to get the old GenEnums TaskPerformer running in 3.0.10.0611.

The old code has this:

string connString = executingGenerator.ProjectDefinition.ConnectionString;

It looks like the ConnectionString property has moved but I can’t seem to find it anywhere.

I tried CreateConnectionStringForDatabase which created a connection string but pointed to the wrong database.

Where did the property go?

Also, is there any documentation for creating TaskPerformers?

Thanks

Rick

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-Jul-2010 05:12:39   

rboarman wrote:

I am trying to get the old GenEnums TaskPerformer running in 3.0.10.0611.

The old code has this:

string connString = executingGenerator.ProjectDefinition.ConnectionString;

It looks like the ConnectionString property has moved but I can’t seem to find it anywhere.

I tried CreateConnectionStringForDatabase which created a connection string but pointed to the wrong database.

Are you using the correct DriverID?

currentProject.CreateConnectionStringKeyNameForDatabase(_executingGenerator.DriverID)

rboarman wrote:

Also, is there any documentation for creating TaskPerformers?

You should check the SDK documentation.

David Elizondo | LLBLGen Support Team
rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 28-Jul-2010 07:38:08   

That's exactly what I tried. It's returning a connection string that is pointing to master instead of the correct database.

Also, how can I get the value of TdlEmitTimeDateInOutputFiles? I couldn't find it anywhere.

Rick

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 28-Jul-2010 10:15:19   

it is pointing to master instead of the catalog, as the catalog is generated into the query, and you can have multiple catalogs in your project so it's unclear what the 'first' catalog is. 'master' always connects.

If you want to replace 'master' with a catalog name, because your query doesn't have catalog names, do: var databaseMetaData = project.MetaData.GetMetaDataForDriverID(driverID);

databaseMetaData contains all metadata for a given driverid, e.g. the PopulatedCatalogs property which contains all catalogs in the meta-data read from the db.

TdlEmitTimeDateInoutputFiles is a project setting now, so you should obtain it by reading the "TdlEmitTimeDateInOutputFiles" from the project settings: var emitTimedateInOutput = currentProject.GetRealBoolSettingValue("TdlEmitTimeDateInOutputFiles");

Please see the EF / NH / L2S templates for examples, these are all written in .lpt

Frans Bouma | Lead developer LLBLGen Pro