Class ConnectionRequest

Namespace
Cratis.Arc.Connections
Assembly
Cratis.Arc.Core.dll

Represents a request for resolving a connection.

public record ConnectionRequest : IEquatable<ConnectionRequest>
Inheritance
ConnectionRequest
Implements
Inherited Members
Extension Methods

Constructors

ConnectionRequest(ConnectionRequest)

protected ConnectionRequest(ConnectionRequest original)

Parameters

original ConnectionRequest

ConnectionRequest(string, ConnectionPurpose, IReadOnlyDictionary<string, string>)

Represents a request for resolving a connection.

public ConnectionRequest(string Storage, ConnectionPurpose Purpose, IReadOnlyDictionary<string, string> Scope)

Parameters

Storage string

The kind of storage to connect to, one of WellKnownConnectionStorage.

Purpose ConnectionPurpose

The ConnectionPurpose of the connection.

Scope IReadOnlyDictionary<string, string>

The values identifying what is being connected, for instance the tenant.

Properties

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Purpose

The ConnectionPurpose of the connection.

public ConnectionPurpose Purpose { get; init; }

Property Value

ConnectionPurpose

Scope

The values identifying what is being connected, for instance the tenant.

public IReadOnlyDictionary<string, string> Scope { get; init; }

Property Value

IReadOnlyDictionary<string, string>

Storage

The kind of storage to connect to, one of WellKnownConnectionStorage.

public string Storage { get; init; }

Property Value

string

Methods

Deconstruct(out string, out ConnectionPurpose, out IReadOnlyDictionary<string, string>)

public void Deconstruct(out string Storage, out ConnectionPurpose Purpose, out IReadOnlyDictionary<string, string> Scope)

Parameters

Storage string
Purpose ConnectionPurpose
Scope IReadOnlyDictionary<string, string>

Equals(ConnectionRequest?)

public virtual bool Equals(ConnectionRequest? other)

Parameters

other ConnectionRequest

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

ForTenant(string, ConnectionPurpose, TenantId)

Creates a ConnectionRequest for a tenant.

public static ConnectionRequest ForTenant(string storage, ConnectionPurpose purpose, TenantId tenantId)

Parameters

storage string

The kind of storage to connect to.

purpose ConnectionPurpose

The ConnectionPurpose.

tenantId TenantId

The TenantId to connect for.

Returns

ConnectionRequest

A new ConnectionRequest.

Remarks

An unset tenant and the default tenant address the same data, so both are sent as Default.

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToKey()

Gets a key that identifies the request, independent of the order of the scope values.

public string ToKey()

Returns

string

The key.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ConnectionRequest?, ConnectionRequest?)

public static bool operator ==(ConnectionRequest? left, ConnectionRequest? right)

Parameters

left ConnectionRequest
right ConnectionRequest

Returns

bool

operator !=(ConnectionRequest?, ConnectionRequest?)

public static bool operator !=(ConnectionRequest? left, ConnectionRequest? right)

Parameters

left ConnectionRequest
right ConnectionRequest

Returns

bool