Class EmptyHeaders
- Namespace
- MassTransit.Serialization
- Assembly
- MassTransit.Abstractions.dll
public class EmptyHeaders : Headers, IEnumerable<HeaderValue>, IEnumerable
- Inheritance
-
EmptyHeaders
- Implements
- Inherited Members
- Extension Methods
Fields
Instance
public static readonly EmptyHeaders Instance
Field Value
Methods
GetAll()
Returns all available headers
public IEnumerable<KeyValuePair<string, object>> GetAll()
Returns
GetEnumerator()
public IEnumerator<HeaderValue> GetEnumerator()
Returns
Get<T>(string, T?)
Returns the specified header as the type, returning a default value is the header is not found
public T? Get<T>(string key, T? defaultValue = null) where T : struct
Parameters
keystringThe header name
defaultValueT?The default value of the header if not found
Returns
- T?
The header value
Type Parameters
TThe result type
Get<T>(string, T?)
Returns the specified header as the type, returning a default value is the header is not found
public T? Get<T>(string key, T? defaultValue) where T : class
Parameters
keystringThe header name
defaultValueTThe default value of the header if not found
Returns
- T
The header value
Type Parameters
TThe result type
TryGetHeader(string, out object?)
If the specified header name is found, returns the value of the header as an object
public bool TryGetHeader(string key, out object? value)
Parameters
Returns
- bool
True if the header is present, otherwise false