Exemplo n.º 1
0
 internal SimpleRecord(IDictionary<string, object> data, string tableName, DataStrategy dataStrategy)
 {
     if (data == null) throw new ArgumentNullException("data");
     _tableName = tableName;
     _database = dataStrategy;
     _data = data;
 }
Exemplo n.º 2
0
 private SimpleTransaction(SimpleTransaction copy) : base(copy)
 {
     _adapter            = copy._adapter;
     _database           = copy._database;
     _adapterTransaction = copy._adapterTransaction;
     _transactionRunner  = copy._transactionRunner;
 }
Exemplo n.º 3
0
 private SimpleTransaction(SimpleTransaction copy) : base(copy)
 {
     _adapter = copy._adapter;
     _database = copy._database;
     _adapterTransaction = copy._adapterTransaction;
     _transactionRunner = copy._transactionRunner;
 }
Exemplo n.º 4
0
 public SimpleQuery(Adapter adapter, DataStrategy dataStrategy, string tableName)
 {
     _adapter      = adapter;
     _dataStrategy = dataStrategy;
     _tableName    = tableName;
     _clauses      = new SimpleQueryClauseBase[0];
 }
Exemplo n.º 5
0
        internal static SimpleTransaction Begin(DataStrategy database, string name)
        {
            SimpleTransaction transaction = CreateTransaction(database);

            transaction.Begin(name);
            return(transaction);
        }
Exemplo n.º 6
0
        public static SimpleTransaction Begin(DataStrategy database, IsolationLevel isolationLevel)
        {
            var transaction = CreateTransaction(database, isolationLevel);

            transaction.Begin();
            return(transaction);
        }
Exemplo n.º 7
0
 internal ObjectReference(string name, ObjectReference owner, DataStrategy dataStrategy, string alias)
 {
     _name         = name;
     _owner        = owner;
     _dataStrategy = dataStrategy;
     _alias        = alias;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="dataStrategy">The database which owns the table.</param>
 /// <param name="schema">The schema to which the table belongs.</param>
 internal DynamicTable(string tableName, DataStrategy dataStrategy, DynamicSchema schema)
 {
     _delegates             = new Dictionary <string, Func <object[], object> >();
     _delegatesAsCollection = _delegates;
     _tableName             = tableName;
     _schema       = schema;
     _dataStrategy = dataStrategy;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="dataStrategy">The database which owns the table.</param>
 /// <param name="schema">The schema to which the table belongs.</param>
 internal DynamicTable(string tableName, DataStrategy dataStrategy, DynamicSchema schema)
 {
     _delegates = new Dictionary<string, Func<object[], object>>();
     _delegatesAsCollection = _delegates;
     _tableName = tableName;
     _schema = schema;
     _dataStrategy = dataStrategy;
 }
Exemplo n.º 10
0
 private SimpleQuery(SimpleQuery source,
                     SimpleQueryClauseBase[] clauses)
 {
     _adapter      = source._adapter;
     _dataStrategy = source._dataStrategy;
     _tableName    = source.TableName;
     _clauses      = clauses;
 }
Exemplo n.º 11
0
 private SimpleTransaction(IAdapterWithTransactions adapter, DataStrategy database, IsolationLevel isolationLevel)
 {
     if (adapter == null) throw new ArgumentNullException("adapter");
     if (database == null) throw new ArgumentNullException("database");
     _adapter = adapter;
     _database = database;
     _isolationLevel = isolationLevel;
 }
Exemplo n.º 12
0
        private static SimpleTransaction CreateTransaction(DataStrategy database, IsolationLevel isolationLevel = IsolationLevel.Unspecified)
        {
            var adapterWithTransactions = database.GetAdapter() as IAdapterWithTransactions;

            if (adapterWithTransactions == null)
            {
                throw new NotSupportedException();
            }
            return(new SimpleTransaction(adapterWithTransactions, database, isolationLevel));
        }
Exemplo n.º 13
0
 internal SimpleRecord(IDictionary <string, object> data, string tableName, DataStrategy dataStrategy)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     _tableName = tableName;
     _database  = dataStrategy;
     _data      = data;
 }
Exemplo n.º 14
0
 public SimpleQuery(DataStrategy dataStrategy, string tableName)
 {
     _dataStrategy = dataStrategy;
     if (_dataStrategy != null)
     {
         _adapter = _dataStrategy.GetAdapter();
     }
     _tableName = tableName;
     _clauses   = new SimpleQueryClauseBase[0];
 }
Exemplo n.º 15
0
 private SimpleTransaction(IAdapterWithTransactions adapter, DataStrategy database, IsolationLevel isolationLevel)
 {
     if (adapter == null)
     {
         throw new ArgumentNullException("adapter");
     }
     if (database == null)
     {
         throw new ArgumentNullException("database");
     }
     _adapter        = adapter;
     _database       = database;
     _isolationLevel = isolationLevel;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="dataStrategy">The database which owns the table.</param>
 /// <param name="schema">The schema to which the table belongs.</param>
 internal DynamicTable(string tableName, DataStrategy dataStrategy, DynamicSchema schema)
 {
     _tableName    = tableName;
     _schema       = schema;
     _dataStrategy = dataStrategy;
 }
 public DataStrategyWithOptions(DataStrategy wrappedStrategy, OptionsBase options)
 {
     _options = options;
     _wrappedStrategy = wrappedStrategy.Clone();
     _wrappedStrategy.GetAdapter().Options = options;
 }
Exemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="dataStrategy">The database which owns the table.</param>
 internal DynamicTable(string tableName, DataStrategy dataStrategy)
     : this(tableName, dataStrategy, null)
 {
 }
Exemplo n.º 19
0
 internal static SimpleTransaction Begin(DataStrategy database, string name)
 {
     SimpleTransaction transaction = CreateTransaction(database);
     transaction.Begin(name);
     return transaction;
 }
Exemplo n.º 20
0
 private static SimpleTransaction CreateTransaction(DataStrategy database, IsolationLevel isolationLevel = IsolationLevel.Unspecified)
 {
     var adapterWithTransactions = database.GetAdapter() as IAdapterWithTransactions;
     if (adapterWithTransactions == null) throw new NotSupportedException();
     return new SimpleTransaction(adapterWithTransactions, database, isolationLevel);
 }
Exemplo n.º 21
0
 public DynamicSchema(string name, DataStrategy dataStrategy)
 {
     _name         = name;
     _dataStrategy = dataStrategy;
 }
Exemplo n.º 22
0
 public SimpleRecord(IDictionary <string, object> data, string tableName, DataStrategy dataStrategy)
 {
     _tableName = tableName;
     _database  = dataStrategy;
     _data      = data ?? new Dictionary <string, object>();
 }
Exemplo n.º 23
0
 public SimpleRecord(Database database)
 {
     _data = new HomogenizedKeyDictionary();
     _database = database;
 }
Exemplo n.º 24
0
 public SimpleRecord(DataStrategy database)
 {
     _data = new Dictionary<string, object>(HomogenizedEqualityComparer.DefaultInstance);
     _database = database;
 }
Exemplo n.º 25
0
 internal SimpleRecord(IDictionary<string, object> data, string tableName, DataStrategy dataStrategy)
 {
     _tableName = tableName;
     _database = dataStrategy;
     _data = HomogenizeDataDictionary(data);
 }
Exemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="dataStrategy">The database which owns the table.</param>
 /// <param name="schema">The schema to which the table belongs.</param>
 internal DynamicTable(string tableName, DataStrategy dataStrategy, DynamicSchema schema)
 {
     _tableName = tableName;
     _schema = schema;
     _dataStrategy = dataStrategy;
 }
Exemplo n.º 27
0
 public DynamicSchema(string name, DataStrategy dataStrategy)
 {
     _name = name;
     _database = dataStrategy;
 }
Exemplo n.º 28
0
        /// <summary>
        /// Creates a single-set <see cref="SimpleResultSet"/> from the specified source.
        /// </summary>
        /// <param name="source">The source.</param>
        public static SimpleResultSet Create(IEnumerable <IDictionary <string, object> > source, string tableName, DataStrategy dataStrategy)
        {
            var q = from dict in source
                    select new SimpleRecord(dict, tableName, dataStrategy);

            return(new SimpleResultSet(q));
        }
Exemplo n.º 29
0
 public void SetDataStrategy(DataStrategy dataStrategy)
 {
     _dataStrategy = dataStrategy;
 }
Exemplo n.º 30
0
 internal DynamicReference(string name, DataStrategy dataStrategy)
 {
     _name     = name;
     _database = dataStrategy;
 }
Exemplo n.º 31
0
 internal ObjectReference(string name, ObjectReference owner, DataStrategy dataStrategy) : this(name, owner, dataStrategy, null)
 {
 }
Exemplo n.º 32
0
 public DataStrategyWithOptions(DataStrategy wrappedStrategy, OptionsBase options)
 {
     _options         = options;
     _wrappedStrategy = wrappedStrategy.Clone();
     _wrappedStrategy.GetAdapter().Options = options;
 }
Exemplo n.º 33
0
 public static SimpleTransaction Begin(DataStrategy database, IsolationLevel isolationLevel)
 {
     var transaction = CreateTransaction(database, isolationLevel);
     transaction.Begin();
     return transaction;
 }
Exemplo n.º 34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="dataStrategy">The database which owns the table.</param>
 internal DynamicTable(string tableName, DataStrategy dataStrategy)
     : this(tableName, dataStrategy, null)
 {
 }
Exemplo n.º 35
0
 protected DataStrategy(DataStrategy copy)
 {
     _members = copy._members;
 }
Exemplo n.º 36
0
 protected DataStrategy(DataStrategy copy)
 {
     _members = copy._members;
 }
Exemplo n.º 37
0
 public SimpleRecord(IDictionary<string, object> data, string tableName, DataStrategy dataStrategy)
 {
     _tableName = tableName;
     _database = dataStrategy;
     _data = data ?? new Dictionary<string, object>();
 }
Exemplo n.º 38
0
 public SimpleRecord(DataStrategy database)
 {
     _data     = new Dictionary <string, object>(HomogenizedEqualityComparer.DefaultInstance);
     _database = database;
 }