Skip to content

PdfCacheResult

PdfCacheResult is the outcome contract for a cache lookup or creation, pairing the original PdfCacheRequest with the returned PDF bytes, tracking id, and file path.

Purpose

  • Carries the outcome of a cache lookup or write, including a computed success flag based on whether PDF bytes were returned. (BR-44)

Context

  • Namespace: PdfAPI.Core.Cache
  • Assembly/package: PdfAPI.Core

Public members

Member Signature Purpose
PdfCacheResult(PdfCacheRequest) PdfCacheResult(PdfCacheRequest request) Constructs a result tied to the originating cache request.
Request PdfCacheRequest Request { get; set; } The request that produced this result.
TrackingId long TrackingId { get; set; } The tracking record identifier associated with the cache entry.
Pdf byte[] Pdf { get; set; } The cached PDF bytes, when found or written successfully.
FilePath string FilePath { get; set; } The on-disk path of the cached PDF, when applicable.
Message string Message { get; set; } A human-readable summary of the cache operation's outcome.
Success bool Success => Pdf != null true only when Pdf is non-null. (BR-44)

Behavioral notes

  • Success is computed purely from whether Pdf is non-null; a non-null Message describing an error does not itself affect Success. (BR-44)

Constraints and usage notes

  • Check Success before reading Pdf; a failed lookup leaves Pdf null while Message may still carry diagnostic text.

Sources

  • PdfAPI.Core\Cache\PdfCacheResult.cs