< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.Collection
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/Collection.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 57
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/Collection.cs

#LineLine coverage
 1#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
 2
 3using System.Collections.Generic;
 4using System.ComponentModel.DataAnnotations;
 5using System.ComponentModel.DataAnnotations.Schema;
 6using Jellyfin.Data.Interfaces;
 7
 8namespace Jellyfin.Data.Entities.Libraries
 9{
 10    /// <summary>
 11    /// An entity representing a collection.
 12    /// </summary>
 13    public class Collection : IHasConcurrencyToken
 14    {
 15        /// <summary>
 16        /// Initializes a new instance of the <see cref="Collection"/> class.
 17        /// </summary>
 18        public Collection()
 19        {
 020            Items = new HashSet<CollectionItem>();
 021        }
 22
 23        /// <summary>
 24        /// Gets the id.
 25        /// </summary>
 26        /// <remarks>
 27        /// Identity, Indexed, Required.
 28        /// </remarks>
 29        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 30        public int Id { get; private set; }
 31
 32        /// <summary>
 33        /// Gets or sets the name.
 34        /// </summary>
 35        /// <remarks>
 36        /// Max length = 1024.
 37        /// </remarks>
 38        [MaxLength(1024)]
 39        [StringLength(1024)]
 40        public string? Name { get; set; }
 41
 42        /// <inheritdoc />
 43        [ConcurrencyCheck]
 44        public uint RowVersion { get; private set; }
 45
 46        /// <summary>
 47        /// Gets a collection containing this collection's items.
 48        /// </summary>
 49        public virtual ICollection<CollectionItem> Items { get; private set; }
 50
 51        /// <inheritdoc />
 52        public void OnSavingChanges()
 53        {
 054            RowVersion++;
 055        }
 56    }
 57}

Methods/Properties

.ctor()
OnSavingChanges()