diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-05-06 22:33:52 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-05-06 22:33:52 +1000 |
| commit | 2b66d00175950d845a794422433d4a350cf87775 (patch) | |
| tree | 8b0a77d43d80faab235c14008206a926d4566859 /Tag.cs | |
| parent | 60dd44153b5f2b233dc66032507ee6c9a925ed0e (diff) | |
v0.13av0.13a
Diffstat (limited to 'Tag.cs')
| -rw-r--r-- | Tag.cs | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,6 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; namespace HyperBooru; @@ -15,6 +13,14 @@ public class TagDefinition : HBObject { public string Name { get; set; } public string? Alias { get; set;} public virtual List<TagDefinition> ImplicitTags { get; set; } = new(); + + public static explicit operator ApiModels.TagDefinition(TagDefinition tagDefinition) => new() { + TagDefinitionId = tagDefinition.Guid, + Namespace = tagDefinition.Namespace, + Name = tagDefinition.Name, + Alias = tagDefinition.Alias, + ImplicitTags = tagDefinition.ImplicitTags.Select(td => td.Guid).ToArray() + }; } public class Tag : HBObject { |
