Interface IRepository<TQueryStrategy, TData>
Provides basic repository methods for operations with an IDataStore<TData>.
Namespace: Cqrs.Repositories
Assembly: Cqrs.dll
Syntax
public interface IRepository<TQueryStrategy, TData>
where TQueryStrategy : IQueryStrategy
Type Parameters
Name | Description |
---|---|
TQueryStrategy | |
TData |
Methods
Create(TData)
Create the newly provided data
to storage.
Declaration
void Create(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Create(IEnumerable<TData>)
Create the newly provided data
to storage.
Declaration
void Create(IEnumerable<TData> data)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TData> | data |
Delete(TData)
Will mark the data
as logically (or soft).
Declaration
void Delete(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
DeleteAll()
Delete all contents (normally by use of a truncate operation) in storage.
Declaration
void DeleteAll()
Destroy(TData)
Remove the provided data
from storage.
Declaration
void Destroy(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Load(Guid, Boolean)
Load the TData
from storage identified by the provided rsn
.
Declaration
TData Load(Guid rsn, bool throwExceptionOnMissingEntity = true)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | rsn | The identifier if the |
System.Boolean | throwExceptionOnMissingEntity | If true will throw an System.Exception if no data is found in storage. |
Returns
Type | Description |
---|---|
TData |
Retrieve(ICollectionResultQuery<TQueryStrategy, TData>)
Builds and executes the provided resultQuery
.
Declaration
ICollectionResultQuery<TQueryStrategy, TData> Retrieve(ICollectionResultQuery<TQueryStrategy, TData> resultQuery)
Parameters
Type | Name | Description |
---|---|---|
ICollectionResultQuery<TQueryStrategy, TData> | resultQuery | The ICollectionResultQuery<TQueryStrategy, TData> to build and execute. |
Returns
Type | Description |
---|---|
ICollectionResultQuery<TQueryStrategy, TData> |
Retrieve(ISingleResultQuery<TQueryStrategy, TData>, Boolean)
Builds and executes the provided singleResultQuery
.
Declaration
ISingleResultQuery<TQueryStrategy, TData> Retrieve(ISingleResultQuery<TQueryStrategy, TData> singleResultQuery, bool throwExceptionWhenNoQueryResults = true)
Parameters
Type | Name | Description |
---|---|---|
ISingleResultQuery<TQueryStrategy, TData> | singleResultQuery | The ISingleResultQuery<TQueryStrategy, TData> to build and execute. |
System.Boolean | throwExceptionWhenNoQueryResults | If true will throw an System.Exception if no data is found in storage. |
Returns
Type | Description |
---|---|
ISingleResultQuery<TQueryStrategy, TData> |
Update(TData)
Update the provided data
in storage.
Declaration
void Update(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |