Class GenericContext<T>
Provides out-of-band context between clients and services.
Inheritance
Namespace: Copper.Common.Context
Assembly: Copper.Common.dll
Syntax
[Serializable]
public class GenericContext<T>
Type Parameters
Name | Description |
---|---|
T | The context type. |
Constructors
View SourceGenericContext()
Initializes a new instance of the GenericContext<T> class.
Declaration
public GenericContext()
GenericContext(T)
Initializes a new instance of the GenericContext<T> class.
Declaration
public GenericContext(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value of the out-of-band context. |
Fields
View SourceValue
The value of the out-of-band context.
Declaration
public readonly T Value
Field Value
Type | Description |
---|---|
T |
Properties
View SourceCurrent
Gets or sets the current out-of-band-context.
Declaration
public static GenericContext<T> Current { get; set; }
Property Value
Type | Description |
---|---|
GenericContext<T> | The current out-of-band context. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | A header with name " + _typeName + " and namespace " + _typeNamespace + " already exists in the message. |
Outgoing
Gets the outgoing out-of-band context.
Declaration
public static GenericContext<T> Outgoing { get; }
Property Value
Type | Description |
---|---|
GenericContext<T> | The outgoing out-of-band-context or null if it has not been set. |
Methods
View SourceGetSetValue()
Gets the outgoing out-of-band context.
Declaration
public static GenericContext<T> GetSetValue()
Returns
Type | Description |
---|---|
GenericContext<T> | The outgoing out-of-band context or null if it has not been set. |
IsSet()
Determines whether the outgoing out-of-band context is set.
Declaration
public static bool IsSet()
Returns
Type | Description |
---|---|
System.Boolean |
|
SetOrUpdate(GenericContext<T>)
Sets or updates the outgoing out-of-band context with the specified value.
Declaration
public static void SetOrUpdate(GenericContext<T> genericContext)
Parameters
Type | Name | Description |
---|---|---|
GenericContext<T> | genericContext | The out-of-band context. |