< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.Genre
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/Genre.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 50
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
OnSavingChanges()100%210%

File(s)

/srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/Genre.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using System.ComponentModel.DataAnnotations.Schema;
 3using Jellyfin.Data.Interfaces;
 4
 5namespace Jellyfin.Data.Entities.Libraries
 6{
 7    /// <summary>
 8    /// An entity representing a genre.
 9    /// </summary>
 10    public class Genre : IHasConcurrencyToken
 11    {
 12        /// <summary>
 13        /// Initializes a new instance of the <see cref="Genre"/> class.
 14        /// </summary>
 15        /// <param name="name">The name.</param>
 16        public Genre(string name)
 17        {
 018            Name = name;
 019        }
 20
 21        /// <summary>
 22        /// Gets the id.
 23        /// </summary>
 24        /// <remarks>
 25        /// Identity, Indexed, Required.
 26        /// </remarks>
 27        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 28        public int Id { get; private set; }
 29
 30        /// <summary>
 31        /// Gets or sets the name.
 32        /// </summary>
 33        /// <remarks>
 34        /// Indexed, Required, Max length = 255.
 35        /// </remarks>
 36        [MaxLength(255)]
 37        [StringLength(255)]
 38        public string Name { get; set; }
 39
 40        /// <inheritdoc />
 41        [ConcurrencyCheck]
 42        public uint RowVersion { get; private set; }
 43
 44        /// <inheritdoc />
 45        public void OnSavingChanges()
 46        {
 047            RowVersion++;
 048        }
 49    }
 50}