Esempio n. 1
0
        private void Initialize(string connectionStringName)
        {
            connectionStringName = string.IsNullOrEmpty(connectionStringName) ? "default" : connectionStringName;

            ConnectionConfig info = SimpleDALConfig.GetConnectionConfig(connectionStringName);
            
            _ConnectionString = info.ConnectionString;

            _Schema = SimpleDALConfig.GetSchemaService(info.ProviderName);

            _IsCustomToken = info.IsCustomToken;

            _Factory = DbProviderFactories.GetFactory(info.ProviderName);

            _ParamToken = _Schema.ParameterToken;

            _Connection = CreateConnection();

            _DalLogger = SimpleDALConfig.GetLogService(info.LoggerName);

            _IsLoggable = info.IsDebug;

            _SessionID = Guid.NewGuid().ToString();

            Info("New Create SimpleDB");
            Debug("Connection Name is: " + connectionStringName);
            Debug("Provider is " + info.ProviderName);
        }
Esempio n. 2
0
        private void Initialize(SimpleTransaction trans)
        {
            _ParamToken = trans.DB.ParameterToken;
            _Factory = trans.DB.Factory;
            _Connection = trans.DB.Connection;
            _Transaction = trans.DB.Transaction;
            _Schema = trans.DB.Schema;
            _DistributeDB = true;

            _IsLoggable = trans.DB._IsLoggable;
            _DalLogger = trans.DB._DalLogger;

            _IsCustomToken = trans.DB.IsCustomToken;

            _SessionID = trans.DB._SessionID;
        }