The Bitter Coder Tutorials, Binsor Style IV: Switching Configs
Wed, Jul 16, 2008
2-minute read
public class ConfigDepot
{
public string ConnectionString{ get;set;}
}
machineName=System.Environment.MachineName
if machineName.ToUpper() == "DEVBOX":
connectionString="connStringDEV"
else:
connectionString="connStringPROD"
component "class.conn", ConfigDepot:
ConnectionString = connectionString
static void Main(string[] args)
{
ConfigDepot cl = container.Resolve<ConfigDepot>();
Console.WriteLine(cl.ConnectionString);
}