#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
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 the id.
        /// 
        /// 
        /// Identity, Indexed, Required.
        /// 
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; private set; }
        /// 
        /// Gets or sets the name.
        /// 
        /// 
        /// Max length = 1024.
        /// 
        [MaxLength(1024)]
        [StringLength(1024)]
        public string? Name { get; set; }
        /// 
        [ConcurrencyCheck]
        public uint RowVersion { get; private set; }
        /// 
        /// Gets a collection containing this collection's items.
        /// 
        public virtual ICollection Items { get; private set; }
        /// 
        public void OnSavingChanges()
        {
            RowVersion++;
        }
    }
}