Remove constructor side effects and remove unneeded parameterless constructors
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#pragma warning disable CA2227
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
@@ -18,31 +17,12 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// Initializes a new instance of the <see cref="PersonRole"/> class.
|
||||
/// </summary>
|
||||
/// <param name="type">The role type.</param>
|
||||
/// <param name="itemMetadata">The metadata.</param>
|
||||
public PersonRole(PersonRoleType type, ItemMetadata itemMetadata)
|
||||
public PersonRole(PersonRoleType type)
|
||||
{
|
||||
Type = type;
|
||||
|
||||
if (itemMetadata == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(itemMetadata));
|
||||
}
|
||||
|
||||
itemMetadata.PersonRoles.Add(this);
|
||||
|
||||
Sources = new HashSet<MetadataProviderId>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PersonRole"/> class.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default constructor. Protected due to required properties, but present because EF needs it.
|
||||
/// </remarks>
|
||||
protected PersonRole()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user