Class DomainContextExtensions
Extension methods to IDomainContext.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Namespace: IRM.Domain.Persistance
Assembly: IRM.dll
Syntax
public static class DomainContextExtensions
Methods
Delete<T>(IDomainContext, Guid, Boolean)
Deletes (removes) an aggregate in the context so it can be deleted in the database by calling SaveChanges().
Declaration
public static void Delete<T>(this IDomainContext context, Guid id, bool autoSave = true)
where T : AggregateRoot
Parameters
IDomainContext
context
The domain context. |
System.Guid
id
The unique identity of the aggregate that should be deleted. |
Boolean
autoSave
true if SaveChanges should be called automatically by Delete; otherwise false. |
Type Parameters
T
The type of aggregate. |
Save<T>(IDomainContext, T, Boolean)
Adds an aggregate to the context so it can be saved in the underlying store by calling SaveChanges().
Declaration
public static void Save<T>(this IDomainContext context, T aggregateRoot, bool autoSave = true)
where T : AggregateRoot
Parameters
IDomainContext
context
The domain context. |
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. |
Remarks
This function depends on IsNew to determine if an Add<T>(T, Boolean) or an Update<T>(T, Boolean) should be done.