-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIObjectContainerBuilder.cs
More file actions
97 lines (92 loc) · 4.69 KB
/
IObjectContainerBuilder.cs
File metadata and controls
97 lines (92 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using RapidField.SolidInstruments.Core;
using System;
namespace RapidField.SolidInstruments.ObjectComposition
{
/// <summary>
/// Represents an object that configures and initializes new <see cref="IObjectContainer" /> instances.
/// </summary>
public interface IObjectContainerBuilder : IObjectBuilder<IObjectContainer>
{
/// <summary>
/// Configures the <see cref="IObjectContainer" /> to support production of <typeparamref name="TProduct" />.
/// </summary>
/// <typeparam name="TProduct">
/// The type that is produced by the container.
/// </typeparam>
/// <returns>
/// The current <see cref="ObjectContainerBuilder" />.
/// </returns>
/// <exception cref="ObjectBuilderException">
/// An exception was raised while configuring the <see cref="IObjectContainer" />. See inner exception for details.
/// </exception>
public IObjectContainerBuilder Configure<TProduct>()
where TProduct : class, new();
/// <summary>
/// Configures the <see cref="IObjectContainer" /> to support production of <typeparamref name="TProduct" />.
/// </summary>
/// <typeparam name="TProduct">
/// The type that is produced by the container.
/// </typeparam>
/// <param name="productionFunction">
/// A function that produces the specified type.
/// </param>
/// <returns>
/// The current <see cref="ObjectContainerBuilder" />.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="productionFunction" /> is <see langword="null" />.
/// </exception>
/// <exception cref="ObjectBuilderException">
/// An exception was raised while configuring the <see cref="IObjectContainer" />. See inner exception for details.
/// </exception>
public IObjectContainerBuilder Configure<TProduct>(Func<TProduct> productionFunction)
where TProduct : class;
/// <summary>
/// Configures the <see cref="IObjectContainer" /> to support production of <typeparamref name="TProduct" /> in response to
/// a request for <typeparamref name="TRequest" />.
/// </summary>
/// <typeparam name="TRequest">
/// The request type that identifies the registration.
/// </typeparam>
/// <typeparam name="TProduct">
/// The type that is produced by the container as a result of a request for <typeparamref name="TRequest" />.
/// </typeparam>
/// <returns>
/// The current <see cref="ObjectContainerBuilder" />.
/// </returns>
/// <exception cref="ObjectBuilderException">
/// An exception was raised while configuring the <see cref="IObjectContainer" />. See inner exception for details.
/// </exception>
public IObjectContainerBuilder Configure<TRequest, TProduct>()
where TRequest : class
where TProduct : class, TRequest, new();
/// <summary>
/// Configures the <see cref="IObjectContainer" /> to support production of <typeparamref name="TProduct" /> in response to
/// a request for <typeparamref name="TRequest" />.
/// </summary>
/// <typeparam name="TRequest">
/// The request type that identifies the registration.
/// </typeparam>
/// <typeparam name="TProduct">
/// The type that is produced by the container as a result of a request for <typeparamref name="TRequest" />.
/// </typeparam>
/// <param name="productionFunction">
/// A function that produces the specified type.
/// </param>
/// <returns>
/// The current <see cref="ObjectContainerBuilder" />.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="productionFunction" /> is <see langword="null" />.
/// </exception>
/// <exception cref="ObjectBuilderException">
/// An exception was raised while configuring the <see cref="IObjectContainer" />. See inner exception for details.
/// </exception>
public IObjectContainerBuilder Configure<TRequest, TProduct>(Func<TProduct> productionFunction)
where TRequest : class
where TProduct : class, TRequest;
}
}