コード例 #1
0
ファイル: DbDriverFactory.cs プロジェクト: zyj0021/DbEntry
        private static DbDriver CreateDbDriver(DbDialect dialectClass, string name, string driverClassName,
                                               string connectionString, string dbProviderFactoryName, string act, string auto)
        {
            var autoScheme = AutoScheme.None;

            if (auto.IsNullOrEmpty())
            {
                if (!string.IsNullOrEmpty(act))
                {
                    if (bool.Parse(act))
                    {
                        autoScheme = AutoScheme.CreateTable;
                    }
                }
            }
            else
            {
                autoScheme = (AutoScheme)Enum.Parse(typeof(AutoScheme), auto);
            }
            CheckProperty(dialectClass, connectionString);
            if (driverClassName == "")
            {
                return(dialectClass.CreateDbDriver(name, connectionString, dbProviderFactoryName, autoScheme));
            }
            return((DbDriver)ClassHelper.CreateInstance(driverClassName,
                                                        dialectClass, name, connectionString, dbProviderFactoryName, autoScheme));
        }
コード例 #2
0
ファイル: DbDriverFactory.cs プロジェクト: sfltd/DbEntry
        private static DbDriver CreateDbDriver(DbDialect dialectClass, string name, string driverClassName,
                                               string connectionString, string dbProviderFactoryName, string das)
        {
            var autoScheme = das.ToEnum <AutoScheme>();

            CheckProperty(dialectClass, connectionString);
            if (driverClassName == "")
            {
                return(dialectClass.CreateDbDriver(name, connectionString, dbProviderFactoryName, autoScheme));
            }
            return((DbDriver)ClassHelper.CreateInstance(driverClassName,
                                                        dialectClass, name, connectionString, dbProviderFactoryName, autoScheme));
        }