Share via


HttpRouteCollection Class

 

A collection of IHttpRoute instances.

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

Inheritance Hierarchy

System.Object
  System.Web.Http.HttpRouteCollection

Syntax

[DefaultMemberAttribute("Item")]
public class HttpRouteCollection : ICollection<IHttpRoute>, IEnumerable<IHttpRoute>, 
    IEnumerable, IDisposable
[DefaultMemberAttribute("Item")]
public ref class HttpRouteCollection : ICollection<IHttpRoute^>, 
    IEnumerable<IHttpRoute^>, IEnumerable, IDisposable
[<DefaultMemberAttribute("Item")>]
type HttpRouteCollection = 
    class
        interface ICollection<IHttpRoute>
        interface IEnumerable<IHttpRoute>
        interface IEnumerable
        interface IDisposable
    end
<DefaultMemberAttribute("Item")>
Public Class HttpRouteCollection
    Implements ICollection(Of IHttpRoute), IEnumerable(Of IHttpRoute),
    IEnumerable, IDisposable

Constructors

Name Description
System_CAPS_pubmethod HttpRouteCollection()

Initializes a new instance of the HttpRouteCollection class.

System_CAPS_pubmethod HttpRouteCollection(String)

Initializes a new instance of the HttpRouteCollection class.

Properties

Name Description
System_CAPS_pubproperty Count

Gets the number of items in the collection.

System_CAPS_pubproperty IsReadOnly

Gets a value indicating whether the collection is read-only.

System_CAPS_pubproperty Item[Int32]

Gets or sets the element at the specified index.

System_CAPS_pubproperty Item[String]

Gets or sets the element with the specified route name.

System_CAPS_pubproperty VirtualPathRoot

Gets the virtual path root.

Methods

Name Description
System_CAPS_pubmethod Add(String, IHttpRoute)

Adds an IHttpRoute instance to the collection.

System_CAPS_pubmethod Clear()

Removes all items from the collection.

System_CAPS_pubmethod Contains(IHttpRoute)

Determines whether the collection contains a specific IHttpRoute.

System_CAPS_pubmethod ContainsKey(String)

Determines whether the collection contains an element with the specified key.

System_CAPS_pubmethod CopyTo(IHttpRoute[], Int32)

Copies the route names and IHttpRoute instances of the collection to an array, starting at a particular array index.

System_CAPS_pubmethod CopyTo(KeyValuePair<String, IHttpRoute>[], Int32)

Copies the IHttpRoute instances of the collection to an array, starting at a particular array index.

System_CAPS_pubmethod CreateRoute(String, IDictionary<String, Object>, IDictionary<String, Object>, IDictionary<String, Object>)

Creates an IHttpRoute instance.

System_CAPS_pubmethod CreateRoute(String, IDictionary<String, Object>, IDictionary<String, Object>, IDictionary<String, Object>, HttpMessageHandler)

Creates an IHttpRoute instance.

System_CAPS_pubmethod CreateRoute(String, Object, Object)

Creates an IHttpRoute instance.

System_CAPS_pubmethod Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

System_CAPS_protmethod Dispose(Boolean)

Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetRouteData(HttpRequestMessage)

Gets the route data for a specified HTTP request.

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod GetVirtualPath(HttpRequestMessage, String, IDictionary<String, Object>)

Gets a virtual path.

System_CAPS_pubmethod Insert(Int32, String, IHttpRoute)

Inserts an IHttpRoute instance into the collection.

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethod OnGetEnumerator()

Called internally to get the enumerator for the collection.

System_CAPS_pubmethod Remove(String)

Removes an IHttpRoute instance from the collection.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod TryGetValue(String, IHttpRoute)

Gets the IHttpRoute with the specified route name.

System_CAPS_protmethod ValidateConstraint(String, String, Object)

Validates that a constraint is valid for an IHttpRoute created by a call to the CreateRoute method.

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod ICollection<IHttpRoute>.Add(IHttpRoute)

System_CAPS_pubinterfaceSystem_CAPS_privmethod ICollection<IHttpRoute>.Remove(IHttpRoute)

System_CAPS_pubinterfaceSystem_CAPS_privmethod IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

Extension Methods

Name Description
System_CAPS_pubmethod IgnoreRoute(String, String)

Overloaded. Ignores the specified route.(Defined by HttpRouteCollectionExtensions.)

System_CAPS_pubmethod IgnoreRoute(String, String, Object)

Overloaded. Ignores the specified route.(Defined by HttpRouteCollectionExtensions.)

System_CAPS_pubmethod MapHttpBatchRoute(String, String, HttpBatchHandler)

Maps the specified route for handling HTTP batch requests. (Defined by HttpRouteCollectionExtensions.)

System_CAPS_pubmethod MapHttpRoute(String, String)

Overloaded. Maps the specified route template.(Defined by HttpRouteCollectionExtensions.)

System_CAPS_pubmethod MapHttpRoute(String, String, Object)

Overloaded. Maps the specified route template and sets default route values.(Defined by HttpRouteCollectionExtensions.)

System_CAPS_pubmethod MapHttpRoute(String, String, Object, Object)

Overloaded. Maps the specified route template and sets default route values and constraints.(Defined by HttpRouteCollectionExtensions.)

System_CAPS_pubmethod MapHttpRoute(String, String, Object, Object, HttpMessageHandler)

Overloaded. Maps the specified route template and sets default route values, constraints, and end-point message handler.(Defined by HttpRouteCollectionExtensions.)

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 Namespace

Return to top