Interface IDatabaseAccess<TEntity>
Provides an interface to access a database table or view.
Inherited Members
Namespace: Paradigm.ORM.Data.DatabaseAccess.Generic
Assembly: Paradigm.ORM.Data.dll
Syntax
public interface IDatabaseAccess<TEntity> : IDatabaseAccess, IDisposable where TEntity : class
Type Parameters
Name | Description |
---|---|
TEntity | A type containing or referencing the mapping information. |
Methods
| Improve this Doc View SourceDelete(TEntity)
Deletes a
Declaration
void Delete(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Remarks
If there are more than one element to delete, please use the overloaded method Delete(IEnumerable<TEntity>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
Delete(IEnumerable<TEntity>)
Deletes a list of
Declaration
void Delete(IEnumerable<TEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TEntity> | entities | List of |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
DeleteAsync(TEntity)
Deletes a
Declaration
Task DeleteAsync(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Returns
Type | Description |
---|---|
Task |
Remarks
If there are more than one element to delete, please use the overloaded method Delete(IEnumerable<TEntity>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
DeleteAsync(IEnumerable<TEntity>)
Deletes a list of
Declaration
Task DeleteAsync(IEnumerable<TEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TEntity> | entities | List of |
Returns
Type | Description |
---|---|
Task |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
Insert(TEntity)
Inserts a
Declaration
void Insert(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Remarks
If there are more than one element to insert, please use the overloaded method Insert(IEnumerable<TEntity>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
Insert(IEnumerable<TEntity>)
Inserts a list of
Declaration
void Insert(IEnumerable<TEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TEntity> | entities | List of |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
InsertAsync(TEntity)
Inserts a
Declaration
Task InsertAsync(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Returns
Type | Description |
---|---|
Task |
Remarks
If there are more than one element to insert, please use the overloaded method Insert(IEnumerable<TEntity>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
InsertAsync(IEnumerable<TEntity>)
Inserts a list of
Declaration
Task InsertAsync(IEnumerable<TEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TEntity> | entities | List of |
Returns
Type | Description |
---|---|
Task |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
Select()
Selects a list of all the elements in a table or view.
Declaration
List<TEntity> Select()
Returns
Type | Description |
---|---|
List<TEntity> | A list of |
Remarks
To select filtering results, use the overloaded method
Select(String, Object[])
Selects a list of elements in a table or view.
Declaration
List<TEntity> 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<TEntity> | A list of |
SelectAsync()
Selects a list of all the elements in a table or view.
Declaration
Task<List<TEntity>> SelectAsync()
Returns
Type | Description |
---|---|
Task<List<TEntity>> | A list of |
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<TEntity>> 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<TEntity>> | A list of |
SelectOne(Object[])
Selects one element from the database.
Declaration
TEntity SelectOne(params object[] ids)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | ids | Array of id values. |
Returns
Type | Description |
---|---|
TEntity |
SelectOneAsync(Object[])
Selects one element from the database.
Declaration
Task<TEntity> SelectOneAsync(params object[] ids)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | ids | Array of id values. |
Returns
Type | Description |
---|---|
Task<TEntity> |
Update(TEntity)
Updates a
Declaration
void Update(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Remarks
If there are more than one element to update, please use the overloaded method Update(IEnumerable<TEntity>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
Update(IEnumerable<TEntity>)
Updates a list of
Declaration
void Update(IEnumerable<TEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TEntity> | entities | List of |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.
UpdateAsync(TEntity)
Updates a
Declaration
Task UpdateAsync(TEntity entity)
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity |
Returns
Type | Description |
---|---|
Task |
Remarks
If there are more than one element to update, please use the overloaded method Update(IEnumerable<TEntity>) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.
UpdateAsync(IEnumerable<TEntity>)
Updates a list of
Declaration
Task UpdateAsync(IEnumerable<TEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TEntity> | entities | List of |
Returns
Type | Description |
---|---|
Task |
Remarks
This method utilizes batching to prevent unnecessary roundtrips to the database.