#pragma warning disable CA1711 // Identifiers should not have incorrect suffix #pragma warning disable CA2227 using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Interfaces; namespace Jellyfin.Data.Entities.Libraries { /// /// An entity representing a collection. /// public class Collection : IHasConcurrencyToken { /// /// Initializes a new instance of the class. /// public Collection() { Items = new HashSet(); } /// /// Gets or sets the id. /// /// /// Identity, Indexed, Required. /// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } /// /// Gets or sets the name. /// /// /// Max length = 1024. /// [MaxLength(1024)] [StringLength(1024)] public string? Name { get; set; } /// [ConcurrencyCheck] public uint RowVersion { get; set; } /// /// Gets or sets a collection containing this collection's items. /// public virtual ICollection Items { get; protected set; } /// public void OnSavingChanges() { RowVersion++; } } }