ConsumesAttribute Class¶
Summary¶
Specifies the allowed content types which can be used to select the action based on request’s content-type.
Inheritance Hierarchy¶
System.Object
System.Attribute
Microsoft.AspNet.Mvc.ConsumesAttribute
Syntax¶
public class ConsumesAttribute : Attribute, _Attribute, IResourceFilter, IFilter, IConsumesActionConstraint, IActionConstraint, IActionConstraintMetadata
Constructors¶
-
ConsumesAttribute
(System.String, System.String[])¶ Creates a new instance of [Microsoft.AspNet.Mvc.ConsumesAttribute](Microsoft.AspNet.Mvc.ConsumesAttribute.yml).
Arguments: - contentType (System.String) –
- otherContentTypes (System.String[]) –
public ConsumesAttribute(string contentType, params string[] otherContentTypes)
-
Methods¶
-
Accept
(Microsoft.AspNet.Mvc.ActionConstraintContext)¶ Arguments: - context (Microsoft.AspNet.Mvc.ActionConstraintContext) –
Return type: System.Boolean
public bool Accept(ActionConstraintContext context)
-
OnResourceExecuted
(Microsoft.AspNet.Mvc.ResourceExecutedContext)¶ Arguments: - context (Microsoft.AspNet.Mvc.ResourceExecutedContext) –
public void OnResourceExecuted(ResourceExecutedContext context)
-
OnResourceExecuting
(Microsoft.AspNet.Mvc.ResourceExecutingContext)¶ Arguments: - context (Microsoft.AspNet.Mvc.ResourceExecutingContext) –
public void OnResourceExecuting(ResourceExecutingContext context)
-