Class HeaderAttribute
- Namespace
- Steeltoe.Messaging.Handler.Attributes
- Assembly
- Steeltoe.Messaging.Abstractions.dll
Attribute which indicates that a method parameter should be bound to a message header.
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true)]
public class HeaderAttribute : Attribute
- Inheritance
-
HeaderAttribute
- Inherited Members
Constructors
HeaderAttribute(string, string, bool)
Initializes a new instance of the HeaderAttribute class.
public HeaderAttribute(string name = null, string defaultValue = null, bool required = true)
Parameters
name
stringthe name of the request header to bind to
defaultValue
stringthe default value to use as a fallback
required
boolis the header required
Properties
DefaultValue
Gets or sets the default value to use if header is missing
public virtual string DefaultValue { get; set; }
Property Value
Name
Gets or sets the name of the header to bind to
public virtual string Name { get; set; }
Property Value
Required
Gets or sets a value indicating whether the header binding is required
public virtual bool Required { get; set; }