Funny ContextManager / ConfigurationManager behavior

Funny ContextManager / ConfigurationManager behavior

Old forum URL: forums.lhotka.net/forums/t/6561.aspx


Mousty posted on Thursday, March 05, 2009

Hi I was wondering if someone could explain to me why the original commented line included in the 3.6 framework would work with the Unit Tests when the namespace name is kept to CSLA but doesn't work when the namsepace changed.

I need to make a loop through every name and verify that they are the same.  Otherwise the connection value (original piece of code) from the commented string returns me null.

public static ContextManager<C> GetManager(string database, bool isDatabaseName)

(This is the method where the code is found, under the Data folder)

Could someone explain this to me? Thanks!

 

 

//var connection = ConfigurationManager.ConnectionStrings["database"];

ConnectionStringSettings connection = null;

for (int i = 0; i < ConfigurationManager.ConnectionStrings.Count; i++)

{

if (ConfigurationManager.ConnectionStringsIdea [I].Name.Equals(database))

{

connection = ConfigurationManager.ConnectionStringsIdea [I];

}

}

Copyright (c) Marimer LLC