/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="linqIQueryable">The base generic data access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> public AsyncSelectIQueryableEdmItems(ISelectEdmGenericBase <TDataContext, TLinqEntity> linqIQueryable, AsyncCallback callback, object state) : base(callback, state) { _linqIQueryable = linqIQueryable; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread2)); Thread.Sleep(20); }
/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="linqIQueryable">The base generic data access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> /// <param name="predicate">The predicate expression.</param> public AsyncSelectIQueryableEdmItems(ISelectEdmGenericBase <TDataContext, TLinqEntity> linqIQueryable, AsyncCallback callback, object state, Expression <Func <TLinqEntity, bool> > predicate) : base(callback, state) { _predicate = predicate; _linqIQueryable = linqIQueryable; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread3)); Thread.Sleep(20); }
/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="linqIQueryable">The base generic data access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> /// <param name="queryString">The primary key value.</param> /// <param name="values">The values associated with the predicate string.</param> public AsyncSelectIQueryableEdmItems(ISelectEdmGenericBase <TDataContext, TLinqEntity> linqIQueryable, AsyncCallback callback, object state, string queryString, params System.Data.Objects.ObjectParameter[] values) : base(callback, state) { _values = values; _queryString = queryString; _linqIQueryable = linqIQueryable; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread1)); Thread.Sleep(20); }
// Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { // Dispose managed resources. if (this._insertInstance != null) { ((IDisposable)_insertInstance).Dispose(); } if (this._deleteInstance != null) { ((IDisposable)_deleteInstance).Dispose(); } if (this._updateInstance != null) { ((IDisposable)_updateInstance).Dispose(); } if (this._selectInstance != null) { ((IDisposable)_selectInstance).Dispose(); } } // Call the appropriate methods to clean up // unmanaged resources here. this._insertInstance = null; this._deleteInstance = null; this._updateInstance = null; this._selectInstance = null; // Note disposing has been done. disposed = true; } }
/// <summary> /// Default constructor. /// </summary> /// <param name="configurationDatabaseConnection">The connection string or configuration key.</param> /// <param name="insertInstance">The insert instance; can be null if not in use.</param> /// <param name="deleteInstance">The delete instance; can be null if not in use.</param> /// <param name="updateInstance">The update instance; can be null if not in use.</param> /// <param name="selectInstance">The select instance; can be null if not in use.</param> public EdmTransactions( string configurationDatabaseConnection, IInsertEdmGenericBase <TDataContext, TLinqEntity> insertInstance, IDeleteEdmGenericBase <TDataContext, TLinqEntity> deleteInstance, IUpdateEdmGenericBase <TDataContext, TLinqEntity> updateInstance, ISelectEdmGenericBase <TDataContext, TLinqEntity> selectInstance) { // Check to see if the critical parameters // have been set, throw exception on each. if (String.IsNullOrEmpty(configurationDatabaseConnection)) { throw new ArgumentNullException("configurationDatabaseConnection"); } _configurationDatabaseConnection = configurationDatabaseConnection; _insertInstance = insertInstance; _deleteInstance = deleteInstance; _updateInstance = updateInstance; _selectInstance = selectInstance; }
/// <summary> /// Default constructor. /// </summary> /// <param name="configurationDatabaseConnection">The connection string or configuration key.</param> /// <param name="connectionType">The database connection type.</param> /// <param name="connectionDataType">The database connection query type.</param> /// <param name="dataAccessProvider">The data access provider.</param> public EdmTransactions( string configurationDatabaseConnection, Nequeo.Data.DataType.ConnectionContext.ConnectionType connectionType, Nequeo.Data.DataType.ConnectionContext.ConnectionDataType connectionDataType, IDataAccess dataAccessProvider) { // Check to see if the critical parameters // have been set, throw exception on each. if (String.IsNullOrEmpty(configurationDatabaseConnection)) { throw new ArgumentNullException("configurationDatabaseConnection"); } _configurationDatabaseConnection = configurationDatabaseConnection; // Create an instance of each type. _insertInstance = new InsertEdmGenericBase <TDataContext, TLinqEntity> (typeof(TLinqEntity).Name, connectionType, connectionDataType, dataAccessProvider); _deleteInstance = new DeleteEdmGenericBase <TDataContext, TLinqEntity> (typeof(TLinqEntity).Name, connectionType, connectionDataType, dataAccessProvider); _updateInstance = new UpdateEdmGenericBase <TDataContext, TLinqEntity> (typeof(TLinqEntity).Name, connectionType, connectionDataType, dataAccessProvider); _selectInstance = new SelectEdmGenericBase <TDataContext, TLinqEntity> (typeof(TLinqEntity).Name, connectionType, connectionDataType, dataAccessProvider); }