Class DataAdapter
An abstract class representing the actual data binding to a data source.
Inheritance
Namespace: Cuemon.Data
Assembly: Cuemon.Data.dll
Syntax
public abstract class DataAdapter
Constructors
| Improve this DocDataAdapter()
Initializes a new instance of the DataAdapter class.
Declaration
protected DataAdapter()
DataAdapter(DataManager)
Initializes a new instance of the DataAdapter class.
Declaration
protected DataAdapter(DataManager manager)
Parameters
Type | Name | Description |
---|---|---|
DataManager | manager | The data manager as underlying DSL wrapper logic. |
Properties
| Improve this DocManager
Gets the data manager for this object. Please be aware, that you should only use this for custom methods as you will loose event control on Entity classes by using the manager directly.
Declaration
public DataManager Manager { get; }
Property Value
Type | Description |
---|---|
DataManager | A DataManager object. |
Methods
| Improve this DocDelete(IDataCommand, DbParameter[])
Deletes data from a data source.
Declaration
protected void Delete(IDataCommand dataCommand, params DbParameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
IDataCommand | dataCommand | The data command to execute. |
System.Data.Common.DbParameter[] | parameters | The parameters to use in the command. |
Insert(IDataCommand, QueryInsertAction, DbParameter[])
Inserts data to a data source.
Declaration
protected object Insert(IDataCommand dataCommand, QueryInsertAction action, params DbParameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
IDataCommand | dataCommand | The data command to execute. |
QueryInsertAction | action | The insert action you wish to apply. |
System.Data.Common.DbParameter[] | parameters | The parameters to use in the command. |
Returns
Type | Description |
---|---|
System.Object | A System.Void object. |
Insert(IDataCommand, DbParameter[])
Inserts data to a data source with default insert action, AffectedRows.
Declaration
protected object Insert(IDataCommand dataCommand, params DbParameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
IDataCommand | dataCommand | The data command to execute. |
System.Data.Common.DbParameter[] | parameters | The parameters to use in the command. |
Returns
Type | Description |
---|---|
System.Object | A System.Void object. |
OnDeletedRaised(DataAdapterEventArgs)
Raises the Deleted event.
Declaration
protected virtual void OnDeletedRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnDeletingRaised(DataAdapterEventArgs)
Raises the Deleting event.
Declaration
protected virtual void OnDeletingRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnInsertedRaised(DataAdapterEventArgs)
Raises the Inserted event.
Declaration
protected virtual void OnInsertedRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnInsertingRaised(DataAdapterEventArgs)
Raises the Inserting event.
Declaration
protected virtual void OnInsertingRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnSelectedRaised(DataAdapterEventArgs)
Raises the Selected event.
Declaration
protected virtual void OnSelectedRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnSelectingRaised(DataAdapterEventArgs)
Raises the Selecting event.
Declaration
protected virtual void OnSelectingRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnUpdatedRaised(DataAdapterEventArgs)
Raises the Updated event.
Declaration
protected virtual void OnUpdatedRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
OnUpdatingRaised(DataAdapterEventArgs)
Raises the Updating event.
Declaration
protected virtual void OnUpdatingRaised(DataAdapterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataAdapterEventArgs | e | The DataAdapterEventArgs instance containing the event data. |
Select(IDataCommand, DbParameter[])
Selects data from a data source.
Declaration
protected DbDataReader Select(IDataCommand dataCommand, params DbParameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
IDataCommand | dataCommand | The data command to execute. |
System.Data.Common.DbParameter[] | parameters | The parameters to use in the command. |
Returns
Type | Description |
---|---|
System.Data.Common.DbDataReader | An object supporting the System.Data.Common.DbDataReader interface. |
Update(IDataCommand, DbParameter[])
Updates data in the data source.
Declaration
protected void Update(IDataCommand dataCommand, params DbParameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
IDataCommand | dataCommand | The data command to execute. |
System.Data.Common.DbParameter[] | parameters | The parameters to use in the command. |
Events
| Improve this DocDeleted
Occurs when a Delete operation has completed.
Declaration
public event EventHandler<DataAdapterEventArgs> Deleted
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Deleting
Occurs before a Delete operation.
Declaration
public event EventHandler<DataAdapterEventArgs> Deleting
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Inserted
Occurs when an Insert operation has completed.
Declaration
public event EventHandler<DataAdapterEventArgs> Inserted
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Inserting
Occurs before an Insert operation.
Declaration
public event EventHandler<DataAdapterEventArgs> Inserting
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Selected
Occurs when a Select operation has completed.
Declaration
public event EventHandler<DataAdapterEventArgs> Selected
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Selecting
Occurs before a Select operation.
Declaration
public event EventHandler<DataAdapterEventArgs> Selecting
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Updated
Occurs when an Update operation has completed.
Declaration
public event EventHandler<DataAdapterEventArgs> Updated
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |
Updating
Occurs before an Update operation.
Declaration
public event EventHandler<DataAdapterEventArgs> Updating
Event Type
Type | Description |
---|---|
System.EventHandler<DataAdapterEventArgs> |