-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIDependencyScope.cs
More file actions
66 lines (62 loc) · 2.85 KB
/
IDependencyScope.cs
File metadata and controls
66 lines (62 loc) · 2.85 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
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using System;
namespace RapidField.SolidInstruments.InversionOfControl
{
/// <summary>
/// Represents a shared initialization and disposal scope for container-resolved objects.
/// </summary>
public interface IDependencyScope : IAsyncDisposable, IDisposable
{
/// <summary>
/// Creates a new child initialization and disposal scope for the current <see cref="IDependencyScope" />.
/// </summary>
/// <returns>
/// A new child initialization and disposal scope for the current <see cref="IDependencyScope" />.
/// </returns>
/// <exception cref="CreateDependencyScopeException">
/// An exception was raised while attempting to create the scope.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public IDependencyScope CreateChildScope();
/// <summary>
/// Requests an object of specified type from the associated container for the current <see cref="IDependencyScope" />.
/// </summary>
/// <param name="type">
/// The type of the object to resolve.
/// </param>
/// <returns>
/// An object of specified type from the associated container.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="type" /> is <see langword="null" />.
/// </exception>
/// <exception cref="DependencyResolutionException">
/// An exception was raised while attempting to resolve the dependency.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public Object Resolve(Type type);
/// <summary>
/// Requests an object of specified type from the associated container for the current <see cref="IDependencyScope" />.
/// </summary>
/// <typeparam name="T">
/// The type of the object to resolve.
/// </typeparam>
/// <returns>
/// An object of specified type from the associated container.
/// </returns>
/// <exception cref="DependencyResolutionException">
/// An exception was raised while attempting to resolve the dependency.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public T Resolve<T>()
where T : class;
}
}