Interface IDatabaseAccess
Provides an interface to access a database table or view.
Namespace: Paradigm.ORM.Data.DatabaseAccess
Assembly: Paradigm.ORM.Data.dll
Syntax
public interface IDatabaseAccess : IDisposable
Methods
| Improve this Doc View SourceDelete(IEnumerable<Object>)
Deletes a list of objects from the table or view.
Declaration
void Delete(IEnumerable<object> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Object> | entities | List of entities to delete. |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
Delete(Object)
Deletes an object from the table or view.
Declaration
void Delete(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | Object to delete. |
Remarks
If there are more than one element to delete, please use the overloaded method Delete(IEnumerable<Object>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
DeleteAsync(IEnumerable<Object>)
Deletes a list of objects from the table or view.
Declaration
Task DeleteAsync(IEnumerable<object> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Object> | entities | List of entities to delete. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
DeleteAsync(Object)
Deletes an object from the table or view.
Declaration
Task DeleteAsync(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | Object to delete. |
Returns
Type | Description |
---|---|
Task |
Remarks
If there are more than one element to delete, please use the overloaded method Delete(IEnumerable<Object>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
Insert(IEnumerable<Object>)
Inserts a list of objects into the table or view.
Declaration
void Insert(IEnumerable<object> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Object> | entities | List of entities to insert. |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
Insert(Object)
Inserts an object into the table or view.
Declaration
void Insert(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | Object to insert. |
Remarks
If there are more than one element to insert, please use the overloaded method Insert(IEnumerable<Object>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
InsertAsync(IEnumerable<Object>)
Inserts a list of objects into the table or view.
Declaration
Task InsertAsync(IEnumerable<object> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Object> | entities | List of entities to insert. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
InsertAsync(Object)
Inserts an object into the table or view.
Declaration
Task InsertAsync(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | Object to insert. |
Returns
Type | Description |
---|---|
Task |
Remarks
If there are more than one element to insert, please use the overloaded method Insert(IEnumerable<Object>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
Select()
Selects a list of all the elements in a table or view.
Declaration
List<object> Select()
Returns
Type | Description |
---|---|
List<System.Object> | A list of objects that belong to the table or view. |
Remarks
To select filtering results, use the overloaded method
Select(String, Object[])
Selects a list of elements in a table or view.
Declaration
List<object> Select(string whereClause, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
List<System.Object> | A list of objects that belong to the table or view. |
SelectAsync()
Selects a list of all the elements in a table or view.
Declaration
Task<List<object>> SelectAsync()
Returns
Type | Description |
---|---|
Task<List<System.Object>> | A list of objects that belong to the table or view. |
Remarks
To select filtering results, use the overloaded method
SelectAsync(String, Object[])
Selects a list of elements in a table or view.
Declaration
Task<List<object>> SelectAsync(string whereClause, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
Task<List<System.Object>> | A list of objects that belong to the table or view. |
SelectOne(Object[])
Selects one element from the database.
Declaration
object SelectOne(params object[] ids)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | ids | Array of id values. |
Returns
Type | Description |
---|---|
System.Object | Element with the same id values as the values provider; otherwise null. |
SelectOneAsync(Object[])
Selects one element from the database.
Declaration
Task<object> SelectOneAsync(params object[] ids)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | ids | Array of id values. |
Returns
Type | Description |
---|---|
Task<System.Object> | Element with the same id values as the values provider; otherwise null. |
Update(IEnumerable<Object>)
Updates a list of objects stored in the table or view.
Declaration
void Update(IEnumerable<object> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Object> | entities | List of entities to update. |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
Update(Object)
Updates an object already stored in the table or view.
Declaration
void Update(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | Object to insert. |
Remarks
If there are more than one element to update, please use the overloaded method Update(IEnumerable<Object>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
UpdateAsync(IEnumerable<Object>)
Updates a list of objects stored in the table or view.
Declaration
Task UpdateAsync(IEnumerable<object> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Object> | entities | List of entities to update. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
UpdateAsync(Object)
Updates an object already stored in the table or view.
Declaration
Task UpdateAsync(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | Object to insert. |
Returns
Type | Description |
---|---|
Task |
Remarks
If there are more than one element to update, please use the overloaded method Update(IEnumerable<Object>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.