Share via


DependencyResolverExtensions.GetServices<TService> Method

Resolves multiply registered services.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetServices(Of TService) ( _
    resolver As IDependencyResolver _
) As IEnumerable(Of TService)
'Usage
Dim resolver As IDependencyResolver
Dim returnValue As IEnumerable(Of TService)

returnValue = resolver.GetServices()
public static IEnumerable<TService> GetServices<TService>(
    this IDependencyResolver resolver
)
[ExtensionAttribute]
public:
generic<typename TService>
static IEnumerable<TService>^ GetServices(
    IDependencyResolver^ resolver
)
JScript does not support generic types or methods.

Type Parameters

  • TService
    The type of the requested services.

Parameters

Return Value

Type: System.Collections.Generic.IEnumerable<TService>
The requested services.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDependencyResolver. When you use instance method syntax to call this method, omit the first parameter. For more information, see b8020aae-374d-46a9-bcb7-8cc2390b93b6 or 175ce3ff-9bbf-4e64-8421-faeb81a0bb51.

Remarks

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

See Also

Reference

DependencyResolverExtensions Class

System.Web.Mvc Namespace