Lyo.Common.Metadata 2.0.0

dotnet add package Lyo.Common.Metadata --version 2.0.0
                    
NuGet\Install-Package Lyo.Common.Metadata -Version 2.0.0
                    
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.Common.Metadata" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Common.Metadata" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Common.Metadata" />
                    
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.Common.Metadata --version 2.0.0
                    
#r "nuget: Lyo.Common.Metadata, 2.0.0"
                    
#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.Common.Metadata@2.0.0
                    
#: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.Common.Metadata&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Common.Metadata&version=2.0.0
                    
Install as a Cake Tool

Lyo.Common.Metadata

The record catalogs that turn the bare enums in Lyo.Common.Core into something descriptive live in Lyo.Common.Metadata: MimeTypeInfo is the IANA media-type catalog, FileTypeInfo maps extensions onto those rows, LanguageCodeInfo knows BCP-47 and ISO 639 codes, LyoTypeInfo is the type picker behind config, job, and filter editors.

Records and the extensions that read them ship together because they depend on each other — LyoTypeInfo uses StringExtensions, and FileTypeInfo.FromMimeType reads MimeTypeInfo. Splitting them would have produced a cycle rather than two packages.

This package references Lyo.Common.Core, so a reference here also gives you the primitives. Namespaces sit under the package name: Lyo.Common.Metadata.Records, .Extensions, and .JsonConverters.

Features

  • File and media metadata. MimeTypeInfo is the IANA catalog (Value, aliases, FromValue which strips Content-Type parameters, HttpContentType). FileTypeInfo is the file-type registry: name, extensions, category, and a Mime row. Several file types may share one MIME (Unknown / Bin / Enc all use application/octet-stream). Video rows cover MP4, MOV, MKV, AVI, MPEG, MPEG-TS, 3GP, and HLS. The two-key envelope suffix is TwoKeyEnvelopeSuffix = "2k"; CommonStorageResolutionSuffixes is what Lyo.FileStorage uses when persisted blobs have no explicit metadata. Byte-scale units live on FileSizeUnitInfo.
  • LyoTypeInfo. Type-picker catalog: CLR types (IsClr) plus entries other packages register at startup, with FromType / FromName / ByCategory, widget hints via LyoTypeEditorKind (including Xml, Regex, and a Formatter hint), synthesized T[] and List<T> entries for registered elements, legacy aliases, ToJson / TryValidateJson, and an implicit conversion to Type.
  • Language and platform records. ProgrammingLanguageInfo, LanguageCodeInfo (FromISO639_1, FromBCP_47, FromISO639_3), and SocialPlatformInfo.
  • Network and protocol records. HttpStatusCodeInfo, PortInfo (well-known ports with PortCategory, FromName / FromPort / ByCategory, implicit int), and HttpHeaderInfo (RFC + Lyo contract + common X- names with HttpHeaderCategory / HttpHeaderPresence, FromName / ByCategory, implicit string). Vendor wire names stay in that vendor’s .Models package.
  • Geography and geometry. BoundingBox2D and GeographicInfo (ByCountry, ByState, FromAbbreviation, FromTimeZone). In the split, GeographicInfo moved here from Enums/: it is a registry record that happened to live beside the enums it keys off.
  • Enum-to-record bridges (Extensions/). TypeInfoExtensions (the GetMimeTypeFromExtension / GetFileTypeFromExtension / FromMimeValue family), EnumMetadataExtensions (GetStringValue, GetDescription, IsSingleFlag<T>), and LanguageExtensions.
  • Record converters (JsonConverters/). SocialPlatformInfoJsonConverter and LanguageCodeInfoJsonConverter, including their Nullable* wrappers. They reference System.Text.Json directly rather than depending on Lyo.Common.Json — that indirection is what keeps the two packages from forming a cycle.

Examples

Look up file and MIME data

using Lyo.Common.Core.Enums;
using Lyo.Common.Metadata.Extensions;
using Lyo.Common.Metadata.Records;

FileTypeInfo type = "report.pdf".GetFileTypeFromExtension();
MimeTypeInfo mime = "clip.mkv".GetMimeTypeFromExtension();
string contentType = mime.HttpContentType;

string label = CountryCode.NZ.GetDescription();

Pick a type

using Lyo.Common.Metadata.Records;

// Drives config, job-parameter and query-filter editors.
LyoTypeInfo info = LyoTypeInfo.FromName("int");
Type runtime = LyoTypeInfo.DateTime; // implicit Type
var scalars = LyoTypeInfo.ByCategory(LyoTypeCategory.Scalar);

// Packages register their own non-CLR entries at startup.
LyoTypeInfo.Register(new("cron", LyoTypeCategory.Text, LyoTypeEditorKind.Text));

Records versus enums

Enums live in Lyo.Common.Core; the records that describe them live here. MIME is a catalog (MimeTypeInfo), not an enum: a package that only needs video/mp4 as a string still goes through Metadata. File types point at MIME rows (FileTypeInfo.Mime) so jpg/jpeg share image/jpeg and unknown/bin/enc share application/octet-stream.

Dependencies

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

  • Lyo.Common.Core (direct, lyo)
  • Lyo.Exceptions (direct, lyo)
  • System.Text.Json 10.0.5 (direct, microsoft, netstandard2.0)
  • Microsoft.Bcl.AsyncInterfaces 10.0.5 (transitive, microsoft, netstandard2.0)
  • System.Memory 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 (69)

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

Package Downloads
Lyo.Hashing

Digests, hex encoding, hashing streams, non-cryptographic checksums (CRC/Adler), lightweight file fingerprints (non-security), and optional hashing service.

Lyo.DateAndTime

Date and time utilities and services for the Lyo library suite.

Lyo.Api.Models

API models and data transfer objects for the Lyo API library suite.

Lyo.Compression

A production-ready .NET compression library providing efficient, thread-safe compression for the built-in BCL algorithms (GZip, Deflate, and on net10+ Brotli, ZLib). Additional algorithms (LZ4, LZMA, Snappier, Zstd, BZip2, XZ) ship as separate Lyo.Compression.* addon packages so consumers only pay for what they use.

Lyo.Encryption

A production-ready .NET encryption library providing secure, authenticated encryption with support for multiple algorithms (AES-GCM, ChaCha20Poly1305, RSA), key management, and envelope encryption patterns.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 895 9/9/2026