static SqlConnectionFactory() { ISqlConnectionFactoryData data = ProductionSqlConnectionFactoryData.GetInstance(); _inventoryMapper = GetMapperForConnectionString("InventoryConnectionString", "sqlMap", data); }
public static IBatisNet.DataMapper.ISqlMapper GetMapperForConnectionString(string connectionStringKey, string configName, ISqlConnectionFactoryData data) { ConnectionStringSettings settings = data.ConnectionStringsSettings(connectionStringKey); if (settings != null) { IDomSqlMapBuilder builder = data.CreateDomSqlMapBuilder(); XmlDocument sqlMapConfig = data.GetEmbeddedResourceAsXmlDocument(String.Format("Configs.{0}.config,Persistence", configName)); NameValueCollection properties = new NameValueCollection(); properties.Add(CONNECTION_STRING, settings.ConnectionString); builder.Properties = properties; return(builder.Configure(sqlMapConfig)); } return(null); }