Class AggregateFactory
A factory for creating instances of aggregates.
Inheritance
System.Object
AggregateFactory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Cqrs.Domain.Factories
Assembly: Cqrs.dll
Syntax
public class AggregateFactory : IAggregateFactory
Constructors
AggregateFactory(IDependencyResolver, ILogger)
Instantiates a new instance of AggregateFactory.
Declaration
public AggregateFactory(IDependencyResolver dependencyResolver, ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
IDependencyResolver | dependencyResolver | |
cdmdotnet.Logging.ILogger | logger |
Properties
DependencyResolver
Gets or sets the IDependencyResolver used.
Declaration
protected IDependencyResolver DependencyResolver { get; }
Property Value
Type | Description |
---|---|
IDependencyResolver |
Logger
Gets or sets the cdmdotnet.Logging.ILogger used.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ILogger |
Methods
Create(Type, Nullable<Guid>, Boolean)
Creates instance of type aggregateType
Declaration
public object Create(Type aggregateType, Guid? rsn = null, bool tryDependencyResolutionFirst = true)
Parameters
Type | Name | Description |
---|---|---|
System.Type | aggregateType | The System.Type of the aggregate to create. |
System.Nullable<System.Guid> | rsn | The identifier of the aggregate to create an instance of if an existing aggregate. |
System.Boolean | tryDependencyResolutionFirst | Indicates the use of IDependencyResolver should be tried first. |
Returns
Type | Description |
---|---|
System.Object |
Implements
Create<TAggregate>(Nullable<Guid>, Boolean)
Creates instance of TAggregate
.
Declaration
public virtual TAggregate Create<TAggregate>(Guid? rsn = null, bool tryDependencyResolutionFirst = true)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Guid> | rsn | The identifier of the aggregate to create an instance of if an existing aggregate. |
System.Boolean | tryDependencyResolutionFirst | Indicates the use of IDependencyResolver should be tried first. |
Returns
Type | Description |
---|---|
TAggregate |
Type Parameters
Name | Description |
---|---|
TAggregate | The System.Type of the aggregate to create. |