Show / Hide Table of Contents

Class DatabaseAccess<TEntity>

Provides the means to access a database table or view. This class contains all the standard CRUD methods to work with a table or view.

Inheritance
System.Object
DatabaseAccess
DatabaseAccess<TEntity>
Implements
IDatabaseAccess<TEntity>
IDatabaseAccess
IDisposable
Inherited Members
DatabaseAccess.InsertAsync(Object)
DatabaseAccess.InsertAsync(IEnumerable<Object>)
DatabaseAccess.UpdateAsync(Object)
DatabaseAccess.UpdateAsync(IEnumerable<Object>)
DatabaseAccess.DeleteAsync(Object)
DatabaseAccess.DeleteAsync(IEnumerable<Object>)
DatabaseAccess.ServiceProvider
DatabaseAccess.Connector
DatabaseAccess.BatchManager
DatabaseAccess.Descriptor
DatabaseAccess.CommandBuilderManager
DatabaseAccess.Mapper
DatabaseAccess.NavigationDatabaseAccesses
DatabaseAccess.Dispose()
DatabaseAccess.Insert(Object)
DatabaseAccess.Insert(IEnumerable<Object>)
DatabaseAccess.Update(Object)
DatabaseAccess.Update(IEnumerable<Object>)
DatabaseAccess.Delete(Object)
DatabaseAccess.Delete(IEnumerable<Object>)
DatabaseAccess.BeforeInitialize()
DatabaseAccess.AfterInitialize()
DatabaseAccess.GetStoredProcedure<TProcedure>()
Namespace: Paradigm.ORM.Data.DatabaseAccess.Generic
Assembly: Paradigm.ORM.Data.dll
Syntax
public class DatabaseAccess<TEntity> : DatabaseAccess, IDatabaseAccess<TEntity>, IDatabaseAccess, IDisposable where TEntity : class
Type Parameters
Name Description
TEntity

A type containing or referencing the mapping information.

Constructors

| Improve this Doc View Source

DatabaseAccess(IServiceProvider)

Initializes a new instance of the DatabaseAccess<TEntity> class.

Declaration
public DatabaseAccess(IServiceProvider serviceProvider)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider.

| Improve this Doc View Source

DatabaseAccess(IServiceProvider, IDatabaseConnector)

Initializes a new instance of the DatabaseAccess<TEntity> class.

Declaration
public DatabaseAccess(IServiceProvider serviceProvider, IDatabaseConnector connector)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider.

IDatabaseConnector connector

The database connector.

| Improve this Doc View Source

DatabaseAccess(IDatabaseConnector)

Initializes a new instance of the DatabaseAccess<TEntity> class.

Declaration
public DatabaseAccess(IDatabaseConnector connector)
Parameters
Type Name Description
IDatabaseConnector connector

The database connector.

Methods

| Improve this Doc View Source

Delete(TEntity)

Deletes a from the table or view.

Declaration
public virtual void Delete(TEntity entity)
Parameters
Type Name Description
TEntity entity

to delete.

Remarks

If there are more than one element to delete, please use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Delete(System.Collections.Generic.IEnumerable{`0}) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.

| Improve this Doc View Source

Delete(IEnumerable<TEntity>)

Deletes a list of from the table or view.

Declaration
public virtual void Delete(IEnumerable<TEntity> entities)
Parameters
Type Name Description
IEnumerable<TEntity> entities

List of to delete.

Remarks

This method utilizes batching to prevent unnecessary roundtrips to the database.

| Improve this Doc View Source

DeleteAsync(TEntity)

Deletes a from the table or view.

Declaration
public virtual Task DeleteAsync(TEntity entity)
Parameters
Type Name Description
TEntity entity

to delete.

Returns
Type Description
Task
Remarks

If there are more than one element to delete, please use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Delete(System.Collections.Generic.IEnumerable{`0}) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.

| Improve this Doc View Source

DeleteAsync(IEnumerable<TEntity>)

Deletes a list of from the table or view.

Declaration
public virtual Task DeleteAsync(IEnumerable<TEntity> entities)
Parameters
Type Name Description
IEnumerable<TEntity> entities

List of to delete.

Returns
Type Description
Task
Remarks

This method utilizes batching to prevent unnecessary roundtrips to the database.

| Improve this Doc View Source

Insert(TEntity)

Inserts a into the table or view.

Declaration
public virtual void Insert(TEntity entity)
Parameters
Type Name Description
TEntity entity

to insert.

Remarks

If there are more than one element to insert, please use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Insert(System.Collections.Generic.IEnumerable{`0}) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.

| Improve this Doc View Source

Insert(IEnumerable<TEntity>)

Inserts a list of into the table or view.

Declaration
public virtual 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.

| Improve this Doc View Source

InsertAsync(TEntity)

Inserts a into the table or view.

Declaration
public virtual Task InsertAsync(TEntity entity)
Parameters
Type Name Description
TEntity entity

to insert.

Returns
Type Description
Task
Remarks

If there are more than one element to insert, please use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Insert(System.Collections.Generic.IEnumerable{`0}) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.

| Improve this Doc View Source

InsertAsync(IEnumerable<TEntity>)

Inserts a list of into the table or view.

Declaration
public virtual 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.

| Improve this Doc View Source

Select()

Selects a list of all the elements in a table or view.

Declaration
public List<TEntity> Select()
Returns
Type Description
List<TEntity>

A list of .

Remarks

To select filtering results, use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Select(System.String).

| Improve this Doc View Source

Select(String, Object[])

Selects a list of elements in a table or view.

Declaration
public 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 .

| Improve this Doc View Source

SelectAsync()

Selects a list of all the elements in a table or view.

Declaration
public Task<List<TEntity>> SelectAsync()
Returns
Type Description
Task<List<TEntity>>

A list of .

Remarks

To select filtering results, use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Select(System.String).

| Improve this Doc View Source

SelectAsync(String, Object[])

Selects a list of elements in a table or view.

Declaration
public 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 .

| Improve this Doc View Source

SelectOne(Object[])

Selects one element from the database.

Declaration
public TEntity SelectOne(params object[] ids)
Parameters
Type Name Description
System.Object[] ids

Array of id values.

Returns
Type Description
TEntity

with the same id values as the values provider; otherwise null.

| Improve this Doc View Source

SelectOneAsync(Object[])

Selects one element from the database.

Declaration
public Task<TEntity> SelectOneAsync(params object[] ids)
Parameters
Type Name Description
System.Object[] ids

Array of id values.

Returns
Type Description
Task<TEntity>

with the same id values as the values provider; otherwise null.

| Improve this Doc View Source

Update(TEntity)

Updates a already stored in the table or view.

Declaration
public virtual void Update(TEntity entity)
Parameters
Type Name Description
TEntity entity

to insert.

Remarks

If there are more than one element to update, please use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Update(System.Collections.Generic.IEnumerable{`0}) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.

| Improve this Doc View Source

Update(IEnumerable<TEntity>)

Updates a list of stored in the table or view.

Declaration
public virtual void Update(IEnumerable<TEntity> entities)
Parameters
Type Name Description
IEnumerable<TEntity> entities

List of to update.

Remarks

This method utilizes batching to prevent unnecessary roundtrips to the database.

| Improve this Doc View Source

UpdateAsync(TEntity)

Updates a already stored in the table or view.

Declaration
public virtual Task UpdateAsync(TEntity entity)
Parameters
Type Name Description
TEntity entity

to insert.

Returns
Type Description
Task
Remarks

If there are more than one element to update, please use the overloaded method Paradigm.ORM.Data.DatabaseAccess.Generic.IDatabaseAccess`1.Update(System.Collections.Generic.IEnumerable{`0}) because is prepared to batch the operation, and preventing unnecessary roundtrips to the database.

| Improve this Doc View Source

UpdateAsync(IEnumerable<TEntity>)

Updates a list of stored in the table or view.

Declaration
public virtual Task UpdateAsync(IEnumerable<TEntity> entities)
Parameters
Type Name Description
IEnumerable<TEntity> entities

List of to update.

Returns
Type Description
Task
Remarks

This method utilizes batching to prevent unnecessary roundtrips to the database.

Implements

IDatabaseAccess<TEntity>
IDatabaseAccess
IDisposable

Extension Methods

ObjectExtensions.ThrowIfFails<TException>(Object, Action, String)
ObjectExtensions.ThrowIfFails<TException, TResult>(Object, Func<TResult>, String)
ObjectExtensions.ThrowIfFailsAsync<TException>(Object, Func<Task>, String)
ObjectExtensions.ThrowIfFailsAsync<TException, TResult>(Object, Func<Task<TResult>>, String)

See Also

DatabaseAccess
IDatabaseAccess<TEntity>
  • Improve this Doc
  • View Source
Powered by MiracleDevs ©2017. Code licensed under the MIT License.
Documentation generated by DocFX.