Partager via


IDependencyResolver.BeginScope Method

Starts a resolution scope.

Namespace:  System.Web.Http.Dependencies
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Function BeginScope As IDependencyScope
'Usage
Dim instance As IDependencyResolver 
Dim returnValue As IDependencyScope 

returnValue = instance.BeginScope()
IDependencyScope BeginScope()
IDependencyScope^ BeginScope()
abstract BeginScope : unit -> IDependencyScope
function BeginScope() : IDependencyScope

Return Value

Type: System.Web.Http.Dependencies.IDependencyScope
The dependency scope.

Remarks

Objects which are resolved in the given scope will belong to that scope, and when the scope is disposed, those objects are returned to the container. Implementers should return a new instance of IDependencyScope every time this method is called, unless the container does not have any concept of scope or resource release (in which case, it would be okay to return 'this', so long as the calls to Dispose() are effectively NOOPs).

See Also

Reference

IDependencyResolver Interface

System.Web.Http.Dependencies Namespace