From 2b66d00175950d845a794422433d4a350cf87775 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Wed, 6 May 2026 22:33:52 +1000 Subject: v0.13a --- Tag.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Tag.cs') diff --git a/Tag.cs b/Tag.cs index 0150b39..172fe8d 100644 --- a/Tag.cs +++ b/Tag.cs @@ -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 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 { -- cgit v1.3