public void InitConfig(IConfigurationSection section) { foreach (IConfigurationSection dbsection in section.GetChildren()) { DbConnectionConfig connectionConfig = new DbConnectionConfig(); connectionConfig.InitConfig(dbsection); Connections.Add(connectionConfig); } }
public IDatabase Build(string ConnectionName) { //this.ConnectionName = ConnectionName; DbConnectionConfig dbconfig = Config.Connections.FirstOrDefault(m => m.Name.ToLower() == ConnectionName.ToLower()); if (dbconfig.IsNotNull()) { var config = new CissyDapperConfiguration(typeof(AutoClassMapper <>), new List <Assembly>(), new K()); var sqlGenerator = new SqlGeneratorImpl(config); T dbconnection = new T(); dbconnection.ConnectionString = dbconfig.GetConnectionString(); return(new DB(dbconnection, sqlGenerator)); } return(default(IDatabase)); }