This project has moved. For the latest updates, please go here.

Hardcoded connectionstring in TransactionManager ConnectionManager

Jun 19, 2013 at 10:44 AM
Hi, I started to use the latest cslagenfork. I realized that the generated code in DataPortal_Insert, update delete is using the following code:.
 using (var ctx = TransactionManager<SqlConnection, SqlTransaction>.GetManager("ConnectionString"))
            {
or
 using (var ctx = ConnectionManager<SqlConnection>.GetManager("ConnectionString"))
            {
I thought, the static Database class is responsible to point to the webconfig to fetch the connectionstring. But I can see that all CSLA classes are hardcoded with "ConnectionString" text to point to webconfig file. I spent couple of hours finding an option on the cslagenfork to get the GetManager method to point to a class but I didn't see any. Can anybody let me know if there is an option such? If so where? I am open to other suggestions.
Thanks in advance.
Coordinator
Jun 21, 2013 at 7:51 AM
Hi,

Using the static class Database is a "by object" option. On each object under 07. Database Access Options there is a Persistence Type option.
SqlConnectionUnshared is the only option that uses the static class Database. Usualy I only use this option for NameValueList stereotypes because when using this option, each object will use its own connection.

The default setting is SqlConnectionManager. I'm planning to drop LinqContext and EFContext as I guess no one uses those options.