Table of Contents

Struct MessageBrokerClientRoutingTarget

Namespace
LfrlAnvil.MessageBroker.Client
Assembly
LfrlAnvil.MessageBroker.Client.dll

Represents a message routing target, based on either a target client id or name.

public readonly struct MessageBrokerClientRoutingTarget
Inherited Members

Properties

Id

Target client id. Equal to 0 if not used.

public int Id { get; }

Property Value

int

IsFromName

Specifies whether this routing target is based on a name.

public bool IsFromName { get; }

Property Value

bool

Name

Target client name. Empty if not used.

public string Name { get; }

Property Value

string

Methods

FromId(int)

Creates a new routing target based on an id.

[Pure]
public static MessageBrokerClientRoutingTarget FromId(int id)

Parameters

id int

Target client id.

Returns

MessageBrokerClientRoutingTarget

New MessageBrokerClientRoutingTarget instance.

Exceptions

ArgumentOutOfRangeException

When id is less than or equal to 0.

FromName(string)

Creates a new routing target based on a name.

[Pure]
public static MessageBrokerClientRoutingTarget FromName(string name)

Parameters

name string

Target client name.

Returns

MessageBrokerClientRoutingTarget

New MessageBrokerClientRoutingTarget instance.

Exceptions

ArgumentOutOfRangeException

When name's length is less than 1 or greater than 512.

ToString()

Returns a string representation of this MessageBrokerClientRoutingTarget instance.

[Pure]
public override string ToString()

Returns

string

String representation.

Operators

implicit operator MessageBrokerClientRoutingTarget(int)

Converts provided id to a routing target.

[Pure]
public static implicit operator MessageBrokerClientRoutingTarget(int id)

Parameters

id int

Target client id.

Returns

MessageBrokerClientRoutingTarget

New MessageBrokerClientRoutingTarget instance.

Exceptions

ArgumentOutOfRangeException

When id is less than or equal to 0.

implicit operator MessageBrokerClientRoutingTarget(string)

Converts provided name to a routing target.

[Pure]
public static implicit operator MessageBrokerClientRoutingTarget(string name)

Parameters

name string

Target client name.

Returns

MessageBrokerClientRoutingTarget

New MessageBrokerClientRoutingTarget instance.

Exceptions

ArgumentOutOfRangeException

When name's length is less than 1 or greater than 512.