Instead of calling ConfigurationManager.ConnectionStrings("db1").ToString()
and ConfigurationManager.ConnectionStrings("db2").ToString()
all over the place in my DAL, would it be fine to create a static global class (ConnStrings
) with static read-only properties (db1
and db2
) and replace the calls with ConnStrings.db1
and ConnStrings.db2
?
Since my connection strings are encrypted, would they get decrypted when I set db1
/db2
or only when it gets accessed?