#pragma warning disable CA2227
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Data.Interfaces;
namespace Jellyfin.Data.Entities.Libraries
{
///
/// An entity containing metadata for a book.
///
public class BookMetadata : ItemMetadata, IHasCompanies
{
///
/// Initializes a new instance of the class.
///
/// The title or name of the object.
/// ISO-639-3 3-character language codes.
/// The book.
public BookMetadata(string title, string language, Book book) : base(title, language)
{
if (book == null)
{
throw new ArgumentNullException(nameof(book));
}
book.BookMetadata.Add(this);
Publishers = new HashSet();
}
///
/// Initializes a new instance of the class.
///
///
/// Default constructor. Protected due to required properties, but present because EF needs it.
///
protected BookMetadata()
{
}
///
/// Gets or sets the ISBN.
///
public long? Isbn { get; set; }
///
/// Gets or sets a collection of the publishers for this book.
///
public virtual ICollection Publishers { get; protected set; }
///
[NotMapped]
public ICollection Companies => Publishers;
}
}