VersionedApiResourceRegistration.RegisterResource Method
Register an API resource location/route. The controller should be named {area}{resource}Controller or it can use a [VersionedApiControllerCustomName] attribute to use a non-conventional name.
Namespace: Microsoft.TeamFoundation.Framework.Server
Assembly: Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)
Syntax
'Declaration
Public Shared Function RegisterResource ( _
routes As HttpRouteCollection, _
locationId As Guid, _
area As String, _
resource As String, _
routeTemplate As String, _
defaults As Object, _
constraints As Object, _
handler As HttpMessageHandler, _
routeName As String, _
resourceVersion As Integer, _
defaultApiVersion As Version, _
minApiVersion As Version, _
maxApiVersion As Version, _
releasedApiVersion As Version _
) As IHttpRoute
public static IHttpRoute RegisterResource(
HttpRouteCollection routes,
Guid locationId,
string area,
string resource,
string routeTemplate,
Object defaults,
Object constraints,
HttpMessageHandler handler,
string routeName,
int resourceVersion,
Version defaultApiVersion,
Version minApiVersion,
Version maxApiVersion,
Version releasedApiVersion
)
public:
static IHttpRoute^ RegisterResource(
HttpRouteCollection^ routes,
Guid locationId,
String^ area,
String^ resource,
String^ routeTemplate,
Object^ defaults,
Object^ constraints,
HttpMessageHandler^ handler,
String^ routeName,
int resourceVersion,
Version^ defaultApiVersion,
Version^ minApiVersion,
Version^ maxApiVersion,
Version^ releasedApiVersion
)
static member RegisterResource :
routes:HttpRouteCollection *
locationId:Guid *
area:string *
resource:string *
routeTemplate:string *
defaults:Object *
constraints:Object *
handler:HttpMessageHandler *
routeName:string *
resourceVersion:int *
defaultApiVersion:Version *
minApiVersion:Version *
maxApiVersion:Version *
releasedApiVersion:Version -> IHttpRoute
public static function RegisterResource(
routes : HttpRouteCollection,
locationId : Guid,
area : String,
resource : String,
routeTemplate : String,
defaults : Object,
constraints : Object,
handler : HttpMessageHandler,
routeName : String,
resourceVersion : int,
defaultApiVersion : Version,
minApiVersion : Version,
maxApiVersion : Version,
releasedApiVersion : Version
) : IHttpRoute
Parameters
routes
Type: System.Web.Http.HttpRouteCollectionRoute collection to add the route to
locationId
Type: System.GuidUnique id of the location/route
area
Type: System.StringArea name
resource
Type: System.StringResource name
routeTemplate
Type: System.String(Parameterized) Route template
defaults
Type: System.ObjectOptional defaults object/RouteValueDictionary
constraints
Type: System.ObjectOptional constraints object/RouteValueDictionary
handler
Type: System.Net.Http.HttpMessageHandlerOptional handler to which the request will be dispatched
routeName
Type: System.StringOptional name of the route (can be used to differentiate multiple routes for the same resource)
resourceVersion
Type: System.Int32The current/latest resource version for this resource
defaultApiVersion
Type: System.VersionThe default API version to use if no api version is specified in the request
minApiVersion
Type: System.VersionThe minimum API version supported by this resource
maxApiVersion
Type: System.VersionThe maximum API version supported by this resource
releasedApiVersion
Type: System.VersionThe latest released (non-preview) API version for this resource
Return Value
Type: System.Web.Http.Routing.IHttpRoute
The registered IHttpRoute
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.