CQRS.NET  4.0
A lightweight enterprise Function as a Service (FaaS) framework to write function based serverless and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.
Cqrs.Repositories.Repository< TQueryStrategy, TQueryBuilder, TData > Class Template Reference

Provides basic repository methods for operations with an IDataStore<TData>. More...

+ Inheritance diagram for Cqrs.Repositories.Repository< TQueryStrategy, TQueryBuilder, TData >:

Public Member Functions

virtual void Create (TData data)
 Create the newly provided data to storage. More...
 
virtual void Create (IEnumerable< TData > data)
 Create the newly provided data to storage. More...
 
virtual ISingleResultQuery< TQueryStrategy, TData > Retrieve (ISingleResultQuery< TQueryStrategy, TData > singleResultQuery, bool throwExceptionWhenNoQueryResults=true)
 Builds and executes the provided singleResultQuery . More...
 
virtual ICollectionResultQuery< TQueryStrategy, TData > Retrieve (ICollectionResultQuery< TQueryStrategy, TData > resultQuery)
 Builds and executes the provided resultQuery . More...
 
virtual void Update (TData data)
 Update the provided data in storage. More...
 
virtual void Delete (TData data)
 Will mark the data as logically (or soft). More...
 
virtual void DeleteAll ()
 Delete all contents (normally by use of a truncate operation) in storage. More...
 
void Destroy (TData data)
 Remove the provided data from storage. More...
 
virtual TData Load (Guid rsn, bool throwExceptionOnMissingEntity=true)
 Load the TData from storage identified by the provided rsn . More...
 

Protected Member Functions

 Repository (Func< IDataStore< TData >> createDataStoreFunction, TQueryBuilder queryBuilder)
 Instantiates a new instance of Repository<TQueryStrategy,TQueryBuilder,TData> More...
 
virtual IQueryable< TData > CreateQueryable (Expression< Func< TData, bool >> predicate)
 Calls CreateDataStoreFunction passing the predicate . More...
 

Properties

Func< IDataStore< TData > > CreateDataStoreFunction [get]
 Gets or sets the Func<TResult> that is used to create new instances of IDataStore<TData>. More...
 
TQueryBuilder QueryBuilder [get]
 Gets or sets the TQueryBuilder that will be used to build queries. More...
 
ITelemetryHelper TelemetryHelper [get, set]
 Gets or sets the ITelemetryHelper. More...
 

Detailed Description

Provides basic repository methods for operations with an IDataStore<TData>.

Template Parameters
TQueryStrategyThe Type of IQueryStrategy.
TQueryBuilderThe Type of the Cqrs.Repositories.Queries.QueryBuilder<TQueryStrategy,TData> that will be used to build queries.
TDataThe Type of data held in storage.
Type Constraints
TQueryStrategy :IQueryStrategy 
TQueryBuilder :QueryBuilder 
TQueryBuilder :TQueryStrategy 
TQueryBuilder :TData 
TData :Entity