Export (0) Print
Expand All

DefaultServices Class

Represents a container for service instances used by the HttpConfiguration. Note that this container only supports known types, and methods to get or set arbitrary service types will throw ArgumentException when called. For creation of arbitrary types, please use IDependencyResolver instead. The supported types for this container are: IActionValueBinderIApiExplorerIAssembliesResolverIBodyModelValidatorIContentNegotiatorIDocumentationProviderIFilterProviderIHostBufferPolicySelectorIHttpActionInvokerIHttpActionSelectorIHttpControllerActivatorIHttpControllerSelectorIHttpControllerTypeResolverITraceManagerITraceWriterIStructuredQueryBuilderModelBinderProviderModelMetadataProviderModelValidatorProviderValueProviderFactoryPassing any type which is not on this to any method on this interface will cause an ArgumentException to be thrown.

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

public ref class DefaultServices : public ServicesContainer

The DefaultServices type exposes the following members.

  NameDescription
Protected methodDefaultServices()Initializes a new instance of the DefaultServices class.
Public methodDefaultServices(HttpConfiguration)Initializes a new instance of the DefaultServices class with a specified HttpConfiguration object.
Top

  NameDescription
Public methodAdd Adds a service to the end of services list for the given service type. (Inherited from ServicesContainer.)
Public methodAddRange Adds the services of the specified collection to the end of the services list for the given service type. (Inherited from ServicesContainer.)
Public methodClear Removes all the service instances of the given service type. (Inherited from ServicesContainer.)
Protected methodClearMultipleRemoves all instances of a multi-instance service type. (Inherited from ServicesContainer.)
Protected methodClearSingleRemoves a single-instance service from the default services. (Overrides ServicesContainer::ClearSingle(Type).)
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Overrides ServicesContainer::Dispose().)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindIndex Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence. (Inherited from ServicesContainer.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetServiceGets a service of the specified type. (Overrides ServicesContainer::GetService(Type).)
Protected methodGetServiceInstancesGets the list of service objects for a given service type, and validates the service type. (Overrides ServicesContainer::GetServiceInstances(Type).)
Public methodGetServicesGets the list of service objects for a given service type. (Overrides ServicesContainer::GetServices(Type).)
Public methodGetType (Inherited from Object.)
Public methodInsert Inserts a service into the collection at the specified index. (Inherited from ServicesContainer.)
Public methodInsertRange Inserts the elements of the collection into the service list at the specified index. (Inherited from ServicesContainer.)
Public methodIsSingleServiceQueries whether a service type is single-instance. (Overrides ServicesContainer::IsSingleService(Type).)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove Removes the first occurrence of the given service from the service list for the given service type. (Inherited from ServicesContainer.)
Public methodRemoveAll Removes all the elements that match the conditions defined by the specified predicate. (Inherited from ServicesContainer.)
Public methodRemoveAt Removes the service at the specified index. (Inherited from ServicesContainer.)
Public methodReplace Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services. (Inherited from ServicesContainer.)
Protected methodReplaceMultipleReplaces all instances of a multi-instance service with a new instance. (Inherited from ServicesContainer.)
Public methodReplaceRange Replaces all existing services for the given service type with the given service instances. (Inherited from ServicesContainer.)
Protected methodReplaceSingleReplaces a single-instance service object. (Overrides ServicesContainer::ReplaceSingle(Type, Object).)
Protected methodResetCacheRemoves the cached values for a single service type. (Overrides ServicesContainer::ResetCache(Type).)
Public methodToString (Inherited from Object.)
Top

  NameDescription
Public Extension MethodGetActionInvokerGets the IHttpActionInvoker service. (Defined by ServicesExtensions.)
Public Extension MethodGetActionSelectorGets the IHttpActionSelector service. (Defined by ServicesExtensions.)
Public Extension MethodGetActionValueBinderGets the IActionValueBinder service. (Defined by ServicesExtensions.)
Public Extension MethodGetApiExplorerGets the IApiExplorer service. (Defined by ServicesExtensions.)
Public Extension MethodGetAssembliesResolverGets the IAssembliesResolver service. (Defined by ServicesExtensions.)
Public Extension MethodGetBodyModelValidatorGets the IBodyModelValidator service. (Defined by ServicesExtensions.)
Public Extension MethodGetContentNegotiatorGets the IContentNegotiator service. (Defined by ServicesExtensions.)
Public Extension MethodGetDocumentationProviderGets the IDocumentationProvider service. (Defined by ServicesExtensions.)
Public Extension MethodGetFilterProvidersGets the IFilterProvider collection. (Defined by ServicesExtensions.)
Public Extension MethodGetHostBufferPolicySelectorGets the IHostBufferPolicySelector service. (Defined by ServicesExtensions.)
Public Extension MethodGetHttpControllerActivatorGets the IHttpControllerActivator service. (Defined by ServicesExtensions.)
Public Extension MethodGetHttpControllerSelectorGets the IHttpControllerSelector service. (Defined by ServicesExtensions.)
Public Extension MethodGetHttpControllerTypeResolverGets the IHttpControllerTypeResolver service. (Defined by ServicesExtensions.)
Public Extension MethodGetModelBinderProvidersGets the ModelBinderProvider collection. (Defined by ServicesExtensions.)
Public Extension MethodGetModelMetadataProviderGets the ModelMetadataProvider service. (Defined by ServicesExtensions.)
Public Extension MethodGetModelValidatorProvidersGets the ModelValidatorProvider collection. (Defined by ServicesExtensions.)
Public Extension MethodGetTraceManagerGets the ITraceManager service. (Defined by ServicesExtensions.)
Public Extension MethodGetTraceWriterGets the ITraceWriterservice. (Defined by ServicesExtensions.)
Public Extension MethodGetValueProviderFactoriesGets the ValueProviderFactory collection. (Defined by ServicesExtensions.)
Top

No content here will be updated; please do not add material here.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft