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: IActionValueBinderIApiExplorerIAssembliesResolverIBodyModelValidatorIContentNegotiatorIDocumentationProviderIFilterProviderIHostBufferPolicySelectorIHttpActionInvokerIHttpActionSelectorIHttpControllerActivatorIHttpControllerSelectorIHttpControllerTypeResolverITraceManagerITraceWriterT:System.Web.Http.Query.IStructuredQueryBuilderModelBinderProviderModelMetadataProviderModelValidatorProviderValueProviderFactoryPassing 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)

Inheritance Hierarchy

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

Syntax

public class DefaultServices : ServicesContainer
public ref class DefaultServices : ServicesContainer
type DefaultServices = 
    class
        inherit ServicesContainer
    end
Public Class DefaultServices
    Inherits ServicesContainer

Constructors

Name Description
System_CAPS_protmethod DefaultServices()

Initializes a new instance of the DefaultServices class.

System_CAPS_pubmethod DefaultServices(HttpConfiguration)

Initializes a new instance of the DefaultServices class with a specified HttpConfiguration object.

Methods

Name Description
System_CAPS_pubmethod Add(Type, Object)

Adds a service to the end of services list for the given service type. (Inherited from ServicesContainer.)

System_CAPS_pubmethod AddRange(Type, IEnumerable<Object>)

Adds the services of the specified collection to the end of the services list for the given service type. (Inherited from ServicesContainer.)

System_CAPS_pubmethod Clear(Type)

Removes all the service instances of the given service type. (Inherited from ServicesContainer.)

System_CAPS_protmethod ClearMultiple(Type)

Removes all instances of a multi-instance service type.(Inherited from ServicesContainer.)

System_CAPS_protmethod ClearSingle(Type)

Removes a single-instance service from the default services.(Overrides ServicesContainer.ClearSingle(Type).)

System_CAPS_pubmethod Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.(Inherited from ServicesContainer.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod FindIndex(Type, Predicate<Object>)

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

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetService(Type)

Gets a service of the specified type.(Overrides ServicesContainer.GetService(Type).)

System_CAPS_protmethod GetServiceInstances(Type)

Gets the list of service objects for a given service type, and validates the service type.(Overrides ServicesContainer.GetServiceInstances(Type).)

System_CAPS_pubmethod GetServices(Type)

Gets the list of service objects for a given service type.(Overrides ServicesContainer.GetServices(Type).)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod Insert(Type, Int32, Object)

Inserts a service into the collection at the specified index. (Inherited from ServicesContainer.)

System_CAPS_pubmethod InsertRange(Type, Int32, IEnumerable<Object>)

Inserts the elements of the collection into the service list at the specified index. (Inherited from ServicesContainer.)

System_CAPS_pubmethod IsSingleService(Type)

Queries whether a service type is single-instance.(Overrides ServicesContainer.IsSingleService(Type).)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod Remove(Type, Object)

Removes the first occurrence of the given service from the service list for the given service type. (Inherited from ServicesContainer.)

System_CAPS_pubmethod RemoveAll(Type, Predicate<Object>)

Removes all the elements that match the conditions defined by the specified predicate. (Inherited from ServicesContainer.)

System_CAPS_pubmethod RemoveAt(Type, Int32)

Removes the service at the specified index. (Inherited from ServicesContainer.)

System_CAPS_pubmethod Replace(Type, Object)

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

System_CAPS_protmethod ReplaceMultiple(Type, Object)

Replaces all instances of a multi-instance service with a new instance.(Inherited from ServicesContainer.)

System_CAPS_pubmethod ReplaceRange(Type, IEnumerable<Object>)

Replaces all existing services for the given service type with the given service instances. (Inherited from ServicesContainer.)

System_CAPS_protmethod ReplaceSingle(Type, Object)

Replaces a single-instance service object.(Overrides ServicesContainer.ReplaceSingle(Type, Object).)

System_CAPS_protmethod ResetCache(Type)

Removes the cached values for a single service type.(Overrides ServicesContainer.ResetCache(Type).)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Extension Methods

Name Description
System_CAPS_pubmethod GetActionInvoker()

Gets the IHttpActionInvoker service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetActionSelector()

Gets the IHttpActionSelector service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetActionValueBinder()

Gets the IActionValueBinder service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetApiExplorer()

Gets the IApiExplorer service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetAssembliesResolver()

Gets the IAssembliesResolver service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetBodyModelValidator()

Gets the IBodyModelValidator service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetContentNegotiator()

Gets the IContentNegotiator service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetDocumentationProvider()

Gets the IDocumentationProvider service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetExceptionHandler()

Returns the registered unhandled exception handler, if any.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetExceptionLoggers()

Returns the collection of registered unhandled exception loggers.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetFilterProviders()

Gets the IFilterProvider collection.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetHostBufferPolicySelector()

Gets the IHostBufferPolicySelector service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetHttpControllerActivator()

Gets the IHttpControllerActivator service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetHttpControllerSelector()

Gets the IHttpControllerSelector service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetHttpControllerTypeResolver()

Gets the IHttpControllerTypeResolver service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetModelBinderProviders()

Gets the ModelBinderProvider collection.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetModelMetadataProvider()

Gets the ModelMetadataProvider service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetModelValidatorProviders()

Gets the ModelValidatorProvider collection.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetTraceManager()

Gets the ITraceManager service.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetTraceWriter()

Gets the ITraceWriterservice.(Defined by ServicesExtensions.)

System_CAPS_pubmethod GetValueProviderFactories()

Gets the ValueProviderFactory collection.(Defined by ServicesExtensions.)

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.Http.Services Namespace

Return to top