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. |
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¶
Successis computed purely from whetherPdfis non-null; a non-nullMessagedescribing an error does not itself affectSuccess. (BR-44)
Constraints and usage notes¶
- Check
Successbefore readingPdf; a failed lookup leavesPdfnull whileMessagemay still carry diagnostic text.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Security and authorization
- API reference
Sources¶
PdfAPI.Core\Cache\PdfCacheResult.cs