Lyo.FileMetadataStore 1.0.1

dotnet add package Lyo.FileMetadataStore --version 1.0.1
                    
NuGet\Install-Package Lyo.FileMetadataStore -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lyo.FileMetadataStore" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.FileMetadataStore" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.FileMetadataStore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lyo.FileMetadataStore --version 1.0.1
                    
#r "nuget: Lyo.FileMetadataStore, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lyo.FileMetadataStore@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lyo.FileMetadataStore&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.FileMetadataStore&version=1.0.1
                    
Install as a Cake Tool

Lyo.FileMetadataStore

File identity without bytes. Large systems split:

  1. Blob storage (Lyo.FileStorage) — throughput, multipart uploads, scanners, CDN URLs. 2. Metadata OLTP (this abstraction) — dedupe fingerprints, encryption key ids, multipart session pointers, archival flags.

Clients depend on IFileMetadataStore only where they manipulate canonical Guid file identifiers.

Methods

Operation Responsibility
GetMetadataAsync(Guid fileId) Hydrates FileStoreResult; FileNotFoundException when row missing or logically deleted (soft delete hides tombstones here).
SaveMetadataAsync(Guid, FileStoreResult) Insert or overwrite row keyed by fileId. Implementations enforce uniqueness on hash/external keys (PostgresFileMetadataStore maps fields into columns).
DeleteMetadataAsync(Guid) Soft-delete (sets DeletedAt, row retained): false if missing or already deleted; GetMetadataAsync / FindByHashAsync omit tombstones.
PurgeMetadataAsync(Guid) Hard-delete the metadata row (or .meta JSON for the local store). Idempotent — returns false when there was no record. Used by Lyo.FileStorage.DeleteFileAsync(..., FileDeletionMode.RemoveObjectAndPurgeMetadata) for retention/governance.
FindByHashAsync(byte[] hash) Duplicate detection shortcut — ignores soft-deleted rows (often combined with Lyo.Hashing).
FindByKeyIdAndVersionAsync(string keyId, string? keyVersion) Key rotation audits — active (non–soft-deleted) metadata only, referencing a KMS/KEK logical key/version pair.

FileStoreResult exposes optional DeletedAt (UTC) when present in storage; callers treat metadata without it as active. GetMetadataAsync and FindByHashAsync omit tombstones; admin grids and workbench QueryProject surfaces may include soft-deleted rows and should gate mutating actions on DeletedAt.

Methods — FileAvailability states

FileStoreResult.Availability propagates content gating decisions from the storage pipeline:

State Meaning
Available Default; reads / presigned URLs / direct downloads are permitted.
PendingScan Saved but awaiting a malware/policy scan; FileNotAvailableException on read unless AllowReadQuarantinedForAdmin is set.
PendingDirectUpload Direct-upload BeginDirectUploadAsync has issued a PUT URL but CompleteDirectUploadAsync has not finalized.
Quarantined A scan flagged the content. Admin-only read may be allowed by storage policy.
Rejected A scan or policy hard-rejected the content; reads always fail.

Methods — DekMigrationResult

Returned by MigrateDeksAsync / RotateDeksAsync in Lyo.FileStorage. Records per-file outcomes including Updated, Skipped, and Failed counts plus the failure list, so operators can re-run a key rotation against only the failing subset.

Local file metadata store DI

Lyo.FileMetadataStore.LocalFileMetadataStore is a JSON-backed implementation for single-host scenarios. Registered through Extensions:

Extension Notes
services.AddLocalFileMetadataStore(string rootDirectoryPath) Direct path.
services.AddLocalFileMetadataStore(Func<IServiceProvider, string> resolveRoot) Lazy path resolution (useful for tests or DI-derived paths).
services.AddLocalFileMetadataStoreFromConfiguration(IConfiguration, sectionName = LocalFileMetadataStoreOptions.SectionName) Bind LocalFileMetadataStoreOptions (RootDirectoryPath).
services.AddLocalFileMetadataStoreKeyed(string keyName, string rootDirectoryPath) Keyed registration with both LocalFileMetadataStore and IFileMetadataStore exposed.
services.AddLocalFileMetadataStoreKeyed(string keyName) Returns a LocalFileMetadataStoreBuilder for fluent options/section-based wiring (ConfigureLocalFileStore(...), Build()).

Architectural guidance

Treat metadata writes as eventually consistent relative to blob existence unless you orchestrate Saga-style compensations (Save blob → Save metadata; if latter fails delete blob).

For multi-tenant systems, prepend tenant key to logical file ids outside interface or augment models with partitioning columns inside concrete stores.

Concrete implementations:

See also

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Common — (direct, lyo)
  • Lyo.Compression — (direct, lyo)
  • Lyo.Encryption — (direct, lyo)
  • Lyo.Hashing — (direct, lyo)
  • Microsoft.Extensions.Configuration.Binder 10.0.5 — (direct, microsoft)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 — (direct, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 — (direct, microsoft)
  • Microsoft.Extensions.Options.DataAnnotations 10.0.5 — (direct, microsoft)
  • System.Text.Json 10.0.5 — (direct, microsoft, netstandard2.0)
  • Lyo.Exceptions — (transitive, lyo)
  • Lyo.KeyStore — (transitive, lyo)
  • Lyo.Metrics — (transitive, lyo)
  • Lyo.Result — (transitive, lyo)
  • Lyo.Streams — (transitive, lyo)
  • BouncyCastle.Cryptography 2.6.2 — (transitive, third-party, netstandard2.0)
  • EasyCompressor 2.1.0 — (transitive, third-party)
  • Konscious.Security.Cryptography.Argon2 1.3.1 — (transitive, third-party)
  • Microsoft.Bcl.AsyncInterfaces 10.0.5 — (transitive, microsoft, netstandard2.0)
  • Microsoft.Extensions.Options.ConfigurationExtensions 10.0.5 — (transitive, microsoft)
  • System.Buffers 4.6.1 — (transitive, microsoft, netstandard2.0)
  • System.IO.Hashing 10.0.5 — (transitive, microsoft, net10.0)
  • System.Memory 4.6.3 — (transitive, microsoft, netstandard2.0)
  • System.Threading.Tasks.Extensions 4.6.3 — (transitive, microsoft, netstandard2.0)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on Lyo.FileMetadataStore:

Package Downloads
Lyo.FileStorage

File storage service interface and base implementation for file operations.

Lyo.FileStorage.Web.Components

Reusable Blazor components for file storage workbenches: upload/save, DEK/KEK migration and rotation, metadata/expected-storage browser grids, keystore tools.

Lyo.FileMetadataStore.Postgres

PostgreSQL implementation of the Lyo FileMetadataStore service using Entity Framework Core.

Lyo.FileStorage.S3

S3-compatible file storage (AWS S3, Backblaze B2, MinIO, etc.) for the Lyo FileStorage service using AWSSDK.S3.

Lyo.FileStorage.AzureBlob

Azure Blob Storage-backed implementation of the Lyo.FileStorage IFileStorageService (package name uses the Blob abstraction; implementation uses Azure.Storage.Blobs).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 0 8/18/2026
1.0.0 106 8/16/2026