Language

ServicesContainer Class

An abstract class that provides a container for services used by ASP.NET Web API.

Inheritance Hierarchy

System.Object   System.Web.Http.Controllers.ServicesContainer     System.Web.Http.Controllers.ControllerServices     System.Web.Http.Services.DefaultServices

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

Syntax

'Declaration
Public MustInherit Class ServicesContainer _
    Implements IDisposable
'Usage
Dim instance As ServicesContainer
public abstract class ServicesContainer : IDisposable
public ref class ServicesContainer abstract : IDisposable
[<AbstractClassAttribute>]
type ServicesContainer =
    class 
        interface IDisposable 
    end
public abstract class ServicesContainer implements IDisposable

The ServicesContainer type exposes the following members.

Constructors

Name Description
ServicesContainer Initializes a new instance of the ServicesContainer class.

Top

Methods

Name Description
Add Adds a service to the end of services list for the given service type.
AddRange Adds the services of the specified collection to the end of the services list for the given service type.
Clear Removes all the service instances of the given service type.
ClearMultiple Removes all instances of a multi-instance service type.
ClearSingle Removes a single-instance service type.
Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Equals (Inherited from Object.)
Finalize (Inherited from Object.)
FindIndex Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence.
GetHashCode (Inherited from Object.)
GetService Gets a service instance of a specified type.
GetServiceInstances Gets a mutable list of service instances of a specified type.
GetServices Gets a collection of service instanes of a specified type.
GetType (Inherited from Object.)
Insert Inserts a service into the collection at the specified index.
InsertRange Inserts the elements of the collection into the service list at the specified index.
IsSingleService Determine whether the service type should be fetched with GetService or GetServices.
MemberwiseClone (Inherited from Object.)
Remove Removes the first occurrence of the given service from the service list for the given service type.
RemoveAll Removes all the elements that match the conditions defined by the specified predicate.
RemoveAt Removes the service at the specified index.
Replace Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services.
ReplaceMultiple Replaces all instances of a multi-instance service with a new instance.
ReplaceRange Replaces all existing services for the given service type with the given service instances.
ReplaceSingle Replaces a single-instance service of a specified type.
ResetCache Removes the cached values for a single service type.
ToString (Inherited from Object.)

Top

Extension Methods

Name Description
GetActionInvoker Gets the IHttpActionInvoker service. (Defined by ServicesExtensions.)
GetActionSelector Gets the IHttpActionSelector service. (Defined by ServicesExtensions.)
GetActionValueBinder Gets the IActionValueBinder service. (Defined by ServicesExtensions.)
GetApiExplorer Gets the IApiExplorer service. (Defined by ServicesExtensions.)
GetAssembliesResolver Gets the IAssembliesResolver service. (Defined by ServicesExtensions.)
GetBodyModelValidator Gets the IBodyModelValidator service. (Defined by ServicesExtensions.)
GetContentNegotiator Gets the IContentNegotiator service. (Defined by ServicesExtensions.)
GetDocumentationProvider Gets the IDocumentationProvider service. (Defined by ServicesExtensions.)
GetFilterProviders Gets the IFilterProvider collection. (Defined by ServicesExtensions.)
GetHostBufferPolicySelector Gets the IHostBufferPolicySelector service. (Defined by ServicesExtensions.)
GetHttpControllerActivator Gets the IHttpControllerActivator service. (Defined by ServicesExtensions.)
GetHttpControllerSelector Gets the IHttpControllerSelector service. (Defined by ServicesExtensions.)
GetHttpControllerTypeResolver Gets the IHttpControllerTypeResolver service. (Defined by ServicesExtensions.)
GetModelBinderProviders Gets the ModelBinderProvider collection. (Defined by ServicesExtensions.)
GetModelMetadataProvider Gets the ModelMetadataProvider service. (Defined by ServicesExtensions.)
GetModelValidatorProviders Gets the ModelValidatorProvider collection. (Defined by ServicesExtensions.)
GetTraceManager Gets the ITraceManager service. (Defined by ServicesExtensions.)
GetTraceWriter Gets the ITraceWriterservice. (Defined by ServicesExtensions.)
GetValueProviderFactories Gets the ValueProviderFactory collection. (Defined by ServicesExtensions.)

Top

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

System.Web.Http.Controllers Namespace