Table of Contents

Class ContentResult

Namespace
Quilt4Net.Toolkit.Features.Content
Assembly
Quilt4Net.Toolkit.dll

A resolved content value together with its provenance.

public record ContentResult : IEquatable<ContentResult>
Inheritance
ContentResult
Implements
Inherited Members

Remarks

The older (string Value, bool Success) tuple is kept for backward compatibility, but its Success flag is not a source discriminator — it is true for a cache hit, a stale cache hit and a fresh server fetch alike, and false for a missing API key, a 404, a timeout and an exception alike. Use Source when the distinction matters.

Properties

CanImprove

Whether asking again later could yield a better answer: true only while a translation is queued, false for a dead end, and null when the server did not say.

public bool? CanImprove { get; }

Property Value

bool?

Remarks

Derived rather than carried on the wire, so it can never disagree with FallbackReason. Three-valued on purpose — an older server reports nothing, and "no better result is coming" is a meaningfully different claim from "I don't know", which a plain bool would quietly conflate.

FallbackReason

Why Value is not in the requested language, when it is not. Unknown against a server that predates the field.

public ContentFallbackReason FallbackReason { get; init; }

Property Value

ContentFallbackReason

IsStageFallback

True when the value came from a lower stage than this environment maps to. Orthogonal to FallbackReason — a value can be both.

public bool IsStageFallback { get; init; }

Property Value

bool

ServedLanguageKey

The language Value is actually in. Guid.Empty is the default language; null when the server did not report it.

public Guid? ServedLanguageKey { get; init; }

Property Value

Guid?

Source

Where Value came from.

public required ContentSource Source { get; init; }

Property Value

ContentSource

Stale

True when the value is not known to be current — a stale cache entry, or a default standing in for a value the server never confirmed.

public required bool Stale { get; init; }

Property Value

bool

Success

Whether the lookup path completed without falling back. Retained to match the legacy tuple; prefer Source for anything finer-grained.

public required bool Success { get; init; }

Property Value

bool

Value

The resolved value. Never null — falls back to the caller's default.

public required string Value { get; init; }

Property Value

string