예제 #1
0
        public BaseDataAccess(DataBaseTypes InDBType, bool InUsePetaPoco = true)
        {
            switch (InDBType)
            {
            case DataBaseTypes.DATA:
            {
                this.ConnectionString = BaseConfig.GetDataConnectionString;
                break;
            }

            case DataBaseTypes.DATA_TEST:
            {
                this.ConnectionString = BaseConfig.GetDataTestConnectionString;
                break;
            }

            default:
            {
                throw new NotImplementedException(string.Format("DataBase of type [{0}] was not implemented.", InDBType.ToString()));
            }
            }
            if (InUsePetaPoco)
            {
                this.PetaPocoContext = new Database(this.ConnectionString, "System.Data.SqlClient");
            }
        }