public void Setup()
 {
     Dialect = new SqlServerDialect();
 }
        public void getDb(String dbName = null)
        {
            SqlDialectBase dialect = null;

            if (String.IsNullOrEmpty(dbName))
            {
                dbname = ConfigFileTool.SAPGlobalSettings.GetCodeTemplateDb();
            }
            else
            {
                dbname = dbName;
            }

            if (string.IsNullOrEmpty(dbname))
            {
                throw new Exception("Con't get the db connection");

            }
            netlib = new netlib7(dbname);
            connection = netlib.CreateConnection();

            switch (netlib.ProviderType)
            {
                case netlib7.ProviderTypes.Oracle:
                    break;
                case netlib7.ProviderTypes.SqlServer:
                    dialect = new SqlServerDialect();
                    break;
                case netlib7.ProviderTypes.MsAccess:
                    dialect = new SqlCeDialect();
                    break;
                case netlib7.ProviderTypes.MySql:
                    dialect = new MySqlDialect();
                    break;
                case netlib7.ProviderTypes.PostgreSQL:
                    break;
                case netlib7.ProviderTypes.OleDB:
                    dialect = new SqlCeDialect();
                    break;
                case netlib7.ProviderTypes.SQLite:
                    dialect = new SqliteDialect();
                    break;
                case netlib7.ProviderTypes.Unknown:
                    break;
                default:
                    break;
            }

            var config = new DapperExtensionsConfiguration(typeof(AutoClassMapper<>), new List<Assembly>(), dialect);
            var sqlGenerator = new SqlGeneratorImpl(config);
            Db = new Database(connection, sqlGenerator);
        }