Class ResolvedConnection

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

Represents the result of resolving a connection.

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

Remarks

Every part is optional. A part that is not set leaves the configured value as it is, so a resolver can answer only for the parts it owns — for instance only the Identity.

Constructors

ResolvedConnection(ResolvedConnection)

protected ResolvedConnection(ResolvedConnection original)

Parameters

original ResolvedConnection

ResolvedConnection(string?, string?, string?, ConnectionIdentity?, DateTimeOffset?)

Represents the result of resolving a connection.

public ResolvedConnection(string? ConnectionString = null, string? Database = null, string? Schema = null, ConnectionIdentity? Identity = null, DateTimeOffset? ExpiresAt = null)

Parameters

ConnectionString string

Optional connection string that replaces the configured one.

Database string

Optional name of the database to use.

Schema string

Optional name of the schema to use, for storage that has schemas.

Identity ConnectionIdentity

Optional ConnectionIdentity to authenticate with.

ExpiresAt DateTimeOffset?

Optional point in time after which the result must be resolved again.

Remarks

Every part is optional. A part that is not set leaves the configured value as it is, so a resolver can answer only for the parts it owns — for instance only the Identity.

Fields

Unchanged

Gets a ResolvedConnection that leaves everything as configured.

public static readonly ResolvedConnection Unchanged

Field Value

ResolvedConnection

Properties

ConnectionString

Optional connection string that replaces the configured one.

public string? ConnectionString { get; init; }

Property Value

string

Database

Optional name of the database to use.

public string? Database { get; init; }

Property Value

string

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

ExpiresAt

Optional point in time after which the result must be resolved again.

public DateTimeOffset? ExpiresAt { get; init; }

Property Value

DateTimeOffset?

Identity

Optional ConnectionIdentity to authenticate with.

public ConnectionIdentity? Identity { get; init; }

Property Value

ConnectionIdentity

Schema

Optional name of the schema to use, for storage that has schemas.

public string? Schema { get; init; }

Property Value

string

Methods

Deconstruct(out string?, out string?, out string?, out ConnectionIdentity?, out DateTimeOffset?)

public void Deconstruct(out string? ConnectionString, out string? Database, out string? Schema, out ConnectionIdentity? Identity, out DateTimeOffset? ExpiresAt)

Parameters

ConnectionString string
Database string
Schema string
Identity ConnectionIdentity
ExpiresAt DateTimeOffset?

Equals(ResolvedConnection?)

public virtual bool Equals(ResolvedConnection? other)

Parameters

other ResolvedConnection

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Merge(ResolvedConnection)

Merge another ResolvedConnection on top of this one.

public ResolvedConnection Merge(ResolvedConnection other)

Parameters

other ResolvedConnection

The ResolvedConnection whose parts win when set.

Returns

ResolvedConnection

The merged ResolvedConnection.

Remarks

The Identity is replaced as a whole rather than merged, so a password never ends up next to an access token from another resolver. The earliest ExpiresAt wins.

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ResolvedConnection?, ResolvedConnection?)

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

Parameters

left ResolvedConnection
right ResolvedConnection

Returns

bool

operator !=(ResolvedConnection?, ResolvedConnection?)

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

Parameters

left ResolvedConnection
right ResolvedConnection

Returns

bool