Table of Contents

Class OperationContext

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll

Base class for contexts provided on different operation calls.

public abstract record OperationContext : IEquatable<OperationContext>
Inheritance
OperationContext
Implements
Derived
Inherited Members

Constructors

OperationContext(string, string, CancellationToken)

Base class for contexts provided on different operation calls.

protected OperationContext(string Service, string Operation, CancellationToken CancellationToken)

Parameters

Service string

Service name.

Operation string

Operation name.

CancellationToken CancellationToken

Cancellation token for when this specific call is canceled (not to be confused with operation cancellation).

Properties

CancellationReason

Gets or sets the cancellation reason if cancellation token is canceled.

public string? CancellationReason { get; set; }

Property Value

string

Remarks

This is the reason the specific operation call and cancellation token are canceled and is not related to actual operation cancellation.

CancellationToken

Cancellation token for when this specific call is canceled (not to be confused with operation cancellation).

public CancellationToken CancellationToken { get; init; }

Property Value

CancellationToken

Headers

Gets the set of headers for this call.

public IReadOnlyDictionary<string, string>? Headers { get; init; }

Property Value

IReadOnlyDictionary<string, string>

Remarks

This dictionary is expected to compare keys case-insensitively.

Operation

Operation name.

public string Operation { get; init; }

Property Value

string

Gets outbound links to set on response. This is intentionally mutable as handlers and middleware are welcome to add links.

public IList<NexusLink> OutboundLinks { get; init; }

Property Value

IList<NexusLink>

Service

Service name.

public string Service { get; init; }

Property Value

string