Line data Source code
1 : using System;
2 : using Cqrs.Configuration;
3 :
4 : namespace Cqrs.Domain.Factories
5 : {
6 : /// <summary>
7 : /// A factory for creating instances of aggregates.
8 : /// </summary>
9 : public interface IAggregateFactory
10 : {
11 : /// <summary>
12 : /// Creates instance of <typeparamref name="TAggregate"/>.
13 : /// </summary>
14 : /// <typeparam name="TAggregate">The <see cref="Type"/> of the aggregate to create.</typeparam>
15 : /// <param name="rsn">The identifier of the aggregate to create an instance of if an existing aggregate.</param>
16 : /// <param name="tryDependencyResolutionFirst">Indicates the use of <see cref="IDependencyResolver"/> should be tried first.</param>
17 1 : TAggregate Create<TAggregate>(Guid? rsn = null, bool tryDependencyResolutionFirst = true);
18 :
19 : /// <summary>
20 : /// Creates instance of type <paramref name="aggregateType"/>
21 : /// </summary>
22 : /// <param name="aggregateType">The <see cref="Type"/> of the aggregate to create.</param>
23 : /// <param name="rsn">The identifier of the aggregate to create an instance of if an existing aggregate.</param>
24 : /// <param name="tryDependencyResolutionFirst">Indicates the use of <see cref="IDependencyResolver"/> should be tried first.</param>
25 1 : object Create(Type aggregateType, Guid? rsn = null, bool tryDependencyResolutionFirst = true);
26 : }
27 : }
|