DependencyResolverExtensions Class (System.Web.Mvc)

Switch View :
ScriptFree
.NET Framework Class Library
DependencyResolverExtensions Class

Provides a type-safe implementation of GetService and GetServices.

Inheritance Hierarchy

System.Object
  System.Web.Mvc.DependencyResolverExtensions

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
Syntax

Visual Basic (Declaration)
<ExtensionAttribute> _
Public NotInheritable Class DependencyResolverExtensions
Visual Basic (Usage)
You do not need to declare an instance of a static class in order to access its members.
C#
public static class DependencyResolverExtensions
Visual C++
[ExtensionAttribute]
public ref class DependencyResolverExtensions abstract sealed
JScript
public final class DependencyResolverExtensions

The DependencyResolverExtensions type exposes the following members.

Methods

  Name Description
Public method Static member GetService<TService> Resolves singly registered services that support arbitrary object creation.
Public method Static member GetServices<TService> Resolves multiply registered services.
Top
Remarks

The methods defined in this type provide a simplified, type-safe implementation of IDependencyResolver. These extension methods provide an early-bound and strongly-typed generic implementation of GetService and GetServices(Type) that avoids casting.

For more information about DependencyResolverExtensions, see the entry ASP.NET MVC 3 Service Location on Brad Wilson's blog.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Reference