using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using API.Entities.Interfaces; using Microsoft.EntityFrameworkCore; namespace API.Entities { /// /// Represents a user entered field that is used as a tagging and grouping mechanism /// [Index(nameof(Id), nameof(Promoted), IsUnique = true)] public class CollectionTag : IHasConcurrencyToken { public int Id { get; set; } /// /// Visible title of the Tag /// public string Title { get; set; } /// /// Cover Image for the collection tag /// public byte[] CoverImage { get; set; } /// /// A description of the tag /// public string Summary { get; set; } /// /// A normalized string used to check if the tag already exists in the DB /// public string NormalizedTitle { get; set; } /// /// A promoted collection tag will allow all linked seriesMetadata's Series to show for all users. /// public bool Promoted { get; set; } public ICollection SeriesMetadatas { get; set; } [ConcurrencyCheck] public uint RowVersion { get; set; } public void OnSavingChanges() { RowVersion++; } } }