Class DapperExtensionsDataStore<T>
- Namespace
- Savvyio.Extensions.DapperExtensions
- Assembly
- Savvyio.Extensions.DapperExtensions.dll
Provides a default implementation of the DapperDataStore<T, TOptions> class that is tailored for Plain Old CLR Objects (POCO) usage by DapperExtensions.
public class DapperExtensionsDataStore<T> : DapperDataStore<T, DapperExtensionsQueryOptions<T>>, IDisposable, IPersistentDataStore<T, DapperExtensionsQueryOptions<T>>, IWritableDataStore<T>, IReadableDataStore<T>, ISearchableDataStore<T, DapperExtensionsQueryOptions<T>>, IDeletableDataStore<T>, IDataStore<T> where T : class
Type Parameters
TThe type of the DTO.
- Inheritance
-
DapperExtensionsDataStore<T>
- Implements
-
IDataStore<T>
- Derived
- Inherited Members
Constructors
DapperExtensionsDataStore(IDapperDataSource)
Initializes a new instance of the DapperExtensionsDataStore<T> class.
public DapperExtensionsDataStore(IDapperDataSource source)
Parameters
sourceIDapperDataSourceThe IDapperDataSource that handles actual I/O communication with a source of data.
Methods
CreateAsync(T, Action<AsyncOptions>)
Creates the specified dto asynchronous in the associated IDapperDataSource.
public override Task CreateAsync(T dto, Action<AsyncOptions> setup = null)
Parameters
dtoTThe object to create in the associated IDapperDataSource.
setupAction<AsyncOptions>The AsyncOptions that needs to be configured.
Returns
DeleteAsync(T, Action<AsyncOptions>)
Deletes the specified dto asynchronous in the associated IDapperDataSource.
public override Task DeleteAsync(T dto, Action<AsyncOptions> setup = null)
Parameters
dtoTThe object to delete in the associated IDapperDataSource.
setupAction<AsyncOptions>The AsyncOptions that needs to be configured.
Returns
FindAllAsync(Action<DapperExtensionsQueryOptions<T>>)
Finds all objects matching the specified setup asynchronous in the associated IDapperDataSource.
public override Task<IEnumerable<T>> FindAllAsync(Action<DapperExtensionsQueryOptions<T>> setup = null)
Parameters
setupAction<DapperExtensionsQueryOptions<T>>The DapperQueryOptions that needs to be configured.
Returns
- Task<IEnumerable<T>>
A Task<TResult> that represents the asynchronous operation. The task result either contains the matching objects of the operation or an empty sequence if no match was found.
GetByIdAsync(object, Action<AsyncOptions>)
Loads the object from the specified id asynchronous.
public override Task<T> GetByIdAsync(object id, Action<AsyncOptions> setup = null)
Parameters
idobjectThe key that uniquely identifies the object.
setupAction<AsyncOptions>The AsyncOptions that needs to be configured.
Returns
- Task<T>
A Task<TResult> that represents the asynchronous operation. The task result either contains the object of the operation or
nullif not found.
UpdateAsync(T, Action<AsyncOptions>)
Updates the specified dto asynchronous in the associated IDapperDataSource.
public override Task UpdateAsync(T dto, Action<AsyncOptions> setup = null)
Parameters
dtoTThe object to update in the associated IDapperDataSource.
setupAction<AsyncOptions>The AsyncOptions that needs to be configured.