Table of Contents

Class SqlServerConnectionStorePathResolution

Namespace
ItTiger.TigerQuery.Core
Assembly
ItTiger.TigerQuery.Core.dll
Outcome of choosing a connection-store file path. Either carries a normalized absolute FilePath and the Source that selected it, or an Error and ErrorMessage describing why the highest-priority source that supplied a value could not be used.
public sealed class SqlServerConnectionStorePathResolution
Inheritance
SqlServerConnectionStorePathResolution
Inherited Members

Remarks

A failure never carries a path. The resolver does not fall back to a lower-priority source once a higher-priority one has spoken, so a misconfigured build agent fails visibly instead of quietly using a developer's personal store.

Properties

AttemptedValue

The rejected value, as supplied. Non-null only on failure, and null when the value was null.
public string? AttemptedValue { get; }

Property Value

string

Remarks

A store path is not a secret, so it is safe to echo back to the user; showing it is usually the fastest way to reveal a mistyped option or a badly quoted container variable.

Error

Why resolution failed. None on success.
public SqlServerConnectionStorePathError Error { get; }

Property Value

SqlServerConnectionStorePathError

ErrorMessage

A clean, user-facing failure reason in English. Non-null only when IsSuccess is false.
public string? ErrorMessage { get; }

Property Value

string

Remarks

Core carries no resources. A localizing host should compose its own message from Error, Source, and AttemptedValue and use this only as the neutral fallback.

FilePath

The normalized absolute store path. Non-null only when IsSuccess is true.
public string? FilePath { get; }

Property Value

string

Remarks

Suitable for FilePath. Nothing has been read, created, or checked at this location; that happens when a store is constructed and used.

IsSuccess

Gets whether a usable store file path was selected.
public bool IsSuccess { get; }

Property Value

bool

Source

The source that selected the path, or that supplied the unusable value.
public SqlServerConnectionStorePathSource Source { get; }

Property Value

SqlServerConnectionStorePathSource

Methods

Failure(SqlServerConnectionStorePathSource, SqlServerConnectionStorePathError, string?, string)

Creates a failed resolution.
public static SqlServerConnectionStorePathResolution Failure(SqlServerConnectionStorePathSource source, SqlServerConnectionStorePathError error, string? attemptedValue, string errorMessage)

Parameters

source SqlServerConnectionStorePathSource
The source that supplied the unusable value.
error SqlServerConnectionStorePathError
The reason the value was rejected.
attemptedValue string
The rejected value, or null when the value was null.
errorMessage string
The nonblank English failure reason.

Returns

SqlServerConnectionStorePathResolution
A failure carrying no path.

Exceptions

ArgumentException
error is None, or errorMessage is null, empty, or whitespace.

Success(string, SqlServerConnectionStorePathSource)

Creates a successful resolution.
public static SqlServerConnectionStorePathResolution Success(string filePath, SqlServerConnectionStorePathSource source)

Parameters

filePath string
The nonblank normalized absolute path.
source SqlServerConnectionStorePathSource
The source that selected filePath.

Returns

SqlServerConnectionStorePathResolution
A success carrying filePath and source.

Exceptions

ArgumentException
filePath is null, empty, or whitespace. The parameter name is filePath.