共用方式為


HttpRouteCollectionExtensions.MapResourceRoute 方法 (HttpRouteCollection, TeamFoundationHostType, String, String, Object, Object)

命名空間:  Microsoft.TeamFoundation.Framework.Server
組件:  Microsoft.TeamFoundation.Framework.Server (在 Microsoft.TeamFoundation.Framework.Server.dll 中)

語法

'宣告
<ExtensionAttribute> _
Public Shared Function MapResourceRoute ( _
    routes As HttpRouteCollection, _
    hostType As TeamFoundationHostType, _
    name As String, _
    routeTemplate As String, _
    defaults As Object, _
    constraints As Object _
) As IHttpRoute
public static IHttpRoute MapResourceRoute(
    this HttpRouteCollection routes,
    TeamFoundationHostType hostType,
    string name,
    string routeTemplate,
    Object defaults,
    Object constraints
)

參數

傳回值

型別:System.Web.Http.Routing.IHttpRoute

使用注意事項

在 Visual Basic 和 C# 中,您可以在任何 HttpRouteCollection 型別物件中呼叫這個方法以做為執行個體。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱擴充方法 (Visual Basic)擴充方法 (C# 程式設計手冊)

.NET Framework 安全性

請參閱

參考

HttpRouteCollectionExtensions 類別

MapResourceRoute 多載

Microsoft.TeamFoundation.Framework.Server 命名空間