Interface IDomainContext
Represents a domain context that can be used to retrieve aggregates and save changes in an underlying store.
Inherited Members
Namespace: IRM.Domain.Persistance
Assembly: IRM.dll
Syntax
public interface IDomainContext : IDbContext, IDisposable
Methods
Add<T>(T, Boolean)
Adds an aggregate to the context so it can be saved in the underlying store by calling IRM.Domain.Persistance.IDomainContext.SaveChanges.
Declaration
void Add<T>(T aggregateRoot, bool autoSave = true)
where T : class, IAggregateRoot
Parameters
T
aggregateRoot
The aggregate that should be added to the database. |
Boolean
autoSave
true if SaveChanges should be called automatically by Add; otherwise false. |
Type Parameters
T
The type of aggregate. |
Delete<T>(T, Boolean)
Deletes (removes) an aggregate in the context so it can be deleted from the underlying store by calling IRM.Domain.Persistance.IDomainContext.SaveChanges.
Declaration
void Delete<T>(T aggregateRoot, bool autoSave = true)
where T : class, IAggregateRoot
Parameters
T
aggregateRoot
The aggregate that should be deleted in the database. |
Boolean
autoSave
true if SaveChanges should be called automatically by Delete; otherwise false. |
Type Parameters
T
The type of aggregate. |
GetById<T>(Guid)
Gets an aggregate by unique identity from the underlying store.
Declaration
T GetById<T>(Guid id)
where T : AggregateRoot
Parameters
System.Guid
id
The unique identifier of the aggregate. |
Returns
T
Returns an aggregate. |
Type Parameters
T
The type of aggregate. |
Update<T>(T, Boolean)
Updates an aggregate in the context so it can be saved in the underlying store by calling IRM.Domain.Persistance.IDomainContext.SaveChanges
Declaration
void Update<T>(T aggregateRoot, bool autoSave = true)
where T : class, IAggregateRoot
Parameters
T
aggregateRoot
The aggregate that should be changed in the database. |
Boolean
autoSave
true if SaveChanges should be called automatically by Update; otherwise false. |
Type Parameters
T
The type of aggregate. |