Class HeaderAttribute
Attribute which indicates that a method parameter should be bound to a message header.
Inheritance
System.Object
HeaderAttribute
Namespace: Steeltoe.Messaging.Handler.Attributes
Assembly: Steeltoe.Messaging.Abstractions.dll
Syntax
public class HeaderAttribute : Attribute
Constructors
| Edit this page View SourceHeaderAttribute(String, String, Boolean)
Initializes a new instance of the HeaderAttribute class.
Declaration
public HeaderAttribute(string name = null, string defaultValue = null, bool required = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name of the request header to bind to |
System.String | defaultValue | the default value to use as a fallback |
System.Boolean | required | is the header required |
Properties
| Edit this page View SourceDefaultValue
Gets or sets the default value to use if header is missing
Declaration
public virtual string DefaultValue { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Name
Gets or sets the name of the header to bind to
Declaration
public virtual string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Required
Gets or sets a value indicating whether the header binding is required
Declaration
public virtual bool Required { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |