forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIDependencyScope.cs
More file actions
32 lines (29 loc) · 1.55 KB
/
Copy pathIDependencyScope.cs
File metadata and controls
32 lines (29 loc) · 1.55 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
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
namespace System.Web.Http.Dependencies
{
/// <summary>
/// Represents a scope that is tracked by the dependency injection container. The scope is
/// used to keep track of resources that have been provided, so that they can then be
/// subsequently released when <see cref="IDisposable.Dispose"/> is called.
/// </summary>
public interface IDependencyScope : IDisposable
{
/// <summary>
/// Gets an instance of the given <paramref name="serviceType"/>. Must return <c>null</c>
/// if the service is not available (must not throw).
/// </summary>
/// <param name="serviceType">The object type.</param>
/// <returns>The requested object, if found; <c>null</c> otherwise.</returns>
object GetService(Type serviceType);
/// <summary>
/// Gets all instances of the given <paramref name="serviceType"/>. Must return an empty
/// collection if the service is not available (must not return <c>null</c> or throw).
/// </summary>
/// <param name="serviceType">The object type.</param>
/// <returns>A sequence of instances of the requested <paramref name="serviceType"/>. The sequence
/// should be empty (not <c>null</c>) if no objects of the given type are available.</returns>
IEnumerable<object> GetServices(Type serviceType);
}
}