using System.Text.Json.Serialization; namespace DeepDrftContent.FileDatabase.Models; /// /// Base metadata for media entries /// /// The key used to identify the media file /// The file extension of the media [JsonPolymorphic(TypeDiscriminatorPropertyName = "$type")] [JsonDerivedType(typeof(MetaData), typeDiscriminator: "media")] [JsonDerivedType(typeof(ImageMetaData), typeDiscriminator: "image")] public record MetaData(string MediaKey, string Extension); /// /// Extended metadata for image entries, including aspect ratio /// /// The key used to identify the media file /// The file extension of the media /// The aspect ratio of the image public record ImageMetaData(string MediaKey, string Extension, double AspectRatio) : MetaData(MediaKey, Extension);