AcceptVerbsAttribute Class¶
Specifies what HTTP methods an action supports.
- Namespace
Microsoft.AspNetCore.Mvc
- Assemblies
- Microsoft.AspNetCore.Mvc.Core
Inheritance Hierarchy¶
System.Object
System.Attribute
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute
Syntax¶
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public sealed class AcceptVerbsAttribute : Attribute, _Attribute, IActionHttpMethodProvider, IRouteTemplateProvider
-
class
Microsoft.AspNetCore.Mvc.
AcceptVerbsAttribute
Constructors¶
-
AcceptVerbsAttribute
(System.String)¶ Initializes a new instance of the
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute
class.Arguments: method (System.String) – The HTTP method the action supports. public AcceptVerbsAttribute(string method)
-
AcceptVerbsAttribute
(System.String[]) Initializes a new instance of the
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute
class.Arguments: methods (System.String<System.String>[]) – The HTTP methods the action supports. public AcceptVerbsAttribute(params string[] methods)
-
Properties¶
-
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute.
HttpMethods
¶ Gets the HTTP methods the action supports.
Return type: System.Collections.Generic.IEnumerable<System.String> public IEnumerable<string> HttpMethods { get; }
-
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute.
Order
¶ Return type: System.Nullable<System.Int32> int ? IRouteTemplateProvider.Order { get; }
-
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute.
Template
¶ Return type: System.String string IRouteTemplateProvider.Template { get; }
-
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute.
Name
¶ Return type: System.String public string Name { get; set; }
-
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute.
Order
Gets the route order. The order determines the order of route execution. Routes with a lower order value are tried first. When a route doesn’t specify a value, it gets the value of the
Microsoft.AspNetCore.Mvc.RouteAttribute.Order
or a default value of 0 if theMicrosoft.AspNetCore.Mvc.RouteAttribute
doesn’t define a value on the controller.Return type: System.Int32 public int Order { get; set; }
-
Microsoft.AspNetCore.Mvc.AcceptVerbsAttribute.
Route
¶ The route template. May be null.
Return type: System.String public string Route { get; set; }
-