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
originalResolvedConnection
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
ConnectionStringstringOptional connection string that replaces the configured one.
DatabasestringOptional name of the database to use.
SchemastringOptional name of the schema to use, for storage that has schemas.
IdentityConnectionIdentityOptional ConnectionIdentity to authenticate with.
ExpiresAtDateTimeOffset?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
Properties
ConnectionString
Optional connection string that replaces the configured one.
public string? ConnectionString { get; init; }
Property Value
Database
Optional name of the database to use.
public string? Database { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
ExpiresAt
Optional point in time after which the result must be resolved again.
public DateTimeOffset? ExpiresAt { get; init; }
Property Value
Identity
Optional ConnectionIdentity to authenticate with.
public ConnectionIdentity? Identity { get; init; }
Property Value
Schema
Optional name of the schema to use, for storage that has schemas.
public string? Schema { get; init; }
Property Value
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
ConnectionStringstringDatabasestringSchemastringIdentityConnectionIdentityExpiresAtDateTimeOffset?
Equals(ResolvedConnection?)
public virtual bool Equals(ResolvedConnection? other)
Parameters
otherResolvedConnection
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Merge(ResolvedConnection)
Merge another ResolvedConnection on top of this one.
public ResolvedConnection Merge(ResolvedConnection other)
Parameters
otherResolvedConnectionThe 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
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ResolvedConnection?, ResolvedConnection?)
public static bool operator ==(ResolvedConnection? left, ResolvedConnection? right)
Parameters
leftResolvedConnectionrightResolvedConnection
Returns
operator !=(ResolvedConnection?, ResolvedConnection?)
public static bool operator !=(ResolvedConnection? left, ResolvedConnection? right)
Parameters
leftResolvedConnectionrightResolvedConnection