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.Domain.UnitOfWork< TAuthenticationToken > Class Template Reference

Provides a basic container to control when events are store in an IEventStore<TAuthenticationToken> and then published on an IEventPublisher<TAuthenticationToken>. More...

+ Inheritance diagram for Cqrs.Domain.UnitOfWork< TAuthenticationToken >:

Public Member Functions

 UnitOfWork (ISnapshotAggregateRepository< TAuthenticationToken > snapshotRepository, IAggregateRepository< TAuthenticationToken > repository)
 Instantiates a new instance of UnitOfWork<TAuthenticationToken> More...
 
 UnitOfWork (IAggregateRepository< TAuthenticationToken > repository)
 Instantiates a new instance of UnitOfWork<TAuthenticationToken> More...
 
virtual void Add< TAggregateRoot > (TAggregateRoot aggregate, bool useSnapshots=false)
 Add an item into the IUnitOfWork<TAuthenticationToken> ready to be committed. More...
 
virtual TAggregateRoot Get< TAggregateRoot > (Guid id, int? expectedVersion=null, bool useSnapshots=false)
 Get an item from the IUnitOfWork<TAuthenticationToken> if it has already been loaded or get it from the IAggregateRepository<TAuthenticationToken>. More...
 
virtual TAggregateRoot GetToVersion< TAggregateRoot > (Guid id, int version)
 Get an item from the IUnitOfWork<TAuthenticationToken> up to and including the provided version . More...
 
virtual TAggregateRoot GetToDate< TAggregateRoot > (Guid id, DateTime versionedDate)
 Get an item from the IUnitOfWork<TAuthenticationToken> up to and including the provided versionedDate . More...
 
virtual void Commit ()
 Commit any changed AggregateRoot<TAuthenticationToken> added to this IUnitOfWork<TAuthenticationToken> via Add<T> into the IAggregateRepository<TAuthenticationToken> More...
 

Detailed Description

Provides a basic container to control when events are store in an IEventStore<TAuthenticationToken> and then published on an IEventPublisher<TAuthenticationToken>.

This shouldn't normally be used as a singleton.