Table of Contents

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 string

the name of the request header to bind to

defaultValue string

the default value to use as a fallback

required bool

is 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

string

Name

Gets or sets the name of the header to bind to

public virtual string Name { get; set; }

Property Value

string

Required

Gets or sets a value indicating whether the header binding is required

public virtual bool Required { get; set; }

Property Value

bool