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 company.
///
public class Company : IHasCompanies, IHasConcurrencyToken
{
///
/// Initializes a new instance of the class.
///
public Company()
{
CompanyMetadata = new HashSet();
ChildCompanies = new HashSet();
}
///
/// Gets the id.
///
///
/// Identity, Indexed, Required.
///
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
///
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
///
/// Gets a collection containing the metadata.
///
public virtual ICollection CompanyMetadata { get; private set; }
///
/// Gets a collection containing this company's child companies.
///
public virtual ICollection ChildCompanies { get; private set; }
///
public ICollection Companies => ChildCompanies;
///
public void OnSavingChanges()
{
RowVersion++;
}
}
}