-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
IScopeProvider.cs
24 lines (23 loc) · 1007 Bytes
/
IScopeProvider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
namespace SteroidsDI.Core;
/// <summary>
/// Provider of scoped <see cref="IServiceProvider" />. The mission of this interface is
/// not to CREATE something, but to provide the required object, which was created one way
/// or another before that. That is, it is an interface for STORAGE of objects. This is its
/// difference from <see cref = "IScopeFactory" />.
/// </summary>
public interface IScopeProvider
{
/// <summary>
/// Gets scoped <see cref="IServiceProvider" />, that is,
/// one in which scoped dependencies can be resolved.
/// </summary>
/// <param name="rootProvider">
/// The root <see cref="IServiceProvider" /> object, which the
/// provider may need in order to calculate the current scope.
/// </param>
/// <returns>
/// The scoped <see cref="IServiceProvider" /> object or <c>null</c>
/// if the provider does not have the current scope.
/// </returns>
IServiceProvider? GetScopedServiceProvider(IServiceProvider rootProvider);
}