-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIObjectFactoryConfigurationProductionFunctions.cs
More file actions
43 lines (40 loc) · 2.01 KB
/
IObjectFactoryConfigurationProductionFunctions.cs
File metadata and controls
43 lines (40 loc) · 2.01 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
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using System;
namespace RapidField.SolidInstruments.ObjectComposition
{
/// <summary>
/// Represents a collection of configured types and functions that produce them using an <see cref="ObjectFactory" />.
/// </summary>
public interface IObjectFactoryConfigurationProductionFunctions : IObjectFactoryConfigurationProductionFunctions<Object>
{
}
/// <summary>
/// Represents a collection of configured types and functions that produce them using an
/// <see cref="ObjectFactory{TProductBase}" />.
/// </summary>
/// <typeparam name="TProductBase">
/// The base type from which objects produced by the associated factory derive.
/// </typeparam>
public interface IObjectFactoryConfigurationProductionFunctions<TProductBase>
{
/// <summary>
/// Defines the function that produces the specified type.
/// </summary>
/// <typeparam name="TProduct">
/// The type of the object produced by the function.
/// </typeparam>
/// <param name="function">
/// A function that produces an output of type <typeparamref name="TProduct" />.
/// </param>
/// <exception cref="ArgumentException">
/// A function is already defined for the specified type, <typeparamref name="TProduct" />.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="function" /> is <see langword="null" />.
/// </exception>
public IObjectFactoryConfigurationProductionFunctions<TProductBase> Add<TProduct>(Func<TProduct> function)
where TProduct : class, TProductBase;
}
}