using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Data.Interfaces;
namespace Jellyfin.Data.Entities.Libraries
{
///
/// An entity representing a genre.
///
public class Genre : IHasConcurrencyToken
{
///
/// Initializes a new instance of the class.
///
/// The name.
public Genre(string name)
{
Name = name;
}
///
/// Gets the id.
///
///
/// Identity, Indexed, Required.
///
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
///
/// Gets or sets the name.
///
///
/// Indexed, Required, Max length = 255.
///
[MaxLength(255)]
[StringLength(255)]
public string Name { get; set; }
///
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
///
public void OnSavingChanges()
{
RowVersion++;
}
}
}