summaryrefslogtreecommitdiff
path: root/Tag.cs
blob: 0f7fed26dcc34cc34048447b66f27d636b8e1ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace HyperBooru;

public enum TagSource {
    Internal,
    UserTag
}

public class TagDefinition : HBObject {
    public         TagSource           Source          { get; set; } = TagSource.Internal;
    public         string?             Namespace       { get; set; }
    public         string              Name            { get; set; }
    public virtual List<TagDefinition> ImplicitTags    { get; set; } = new();
}

public class Tag : HBObject {
    public virtual TagDefinition TagDefinition { get; set; }
    public         DateTime      CreateTime    { get; set; } = DateTime.Now;
    public virtual HBObject      Target        { get; set; }

    public Tag() {}

    public Tag(TagDefinition tagDef) =>
        this.TagDefinition = tagDef;
}