DependencyResolverExtensions Class

 

Provides a type-safe implementation of GetService and GetServices.

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

Inheritance Hierarchy

System.Object
  System.Web.Mvc.DependencyResolverExtensions

Syntax

public static class DependencyResolverExtensions
[ExtensionAttribute]
public ref class DependencyResolverExtensions abstract sealed 
[<AbstractClass>]
[<Sealed>]
type DependencyResolverExtensions = class end
<ExtensionAttribute>
Public NotInheritable Class DependencyResolverExtensions

Methods

Name Description
System_CAPS_pubmethodSystem_CAPS_static GetService<TService>(IDependencyResolver)

Resolves singly registered services that support arbitrary object creation.

System_CAPS_pubmethodSystem_CAPS_static GetServices<TService>(IDependencyResolver)

Resolves multiply registered services.

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 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

System.Web.Mvc Namespace

Return to top