using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Data.Entities
{
public partial class BookMetadata : Metadata
{
partial void Init();
///
/// Default constructor. Protected due to required properties, but present because EF needs it.
///
protected BookMetadata()
{
Publishers = new HashSet();
Init();
}
///
/// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
///
public static BookMetadata CreateBookMetadataUnsafe()
{
return new BookMetadata();
}
///
/// Public constructor with required data
///
/// The title or name of the object
/// ISO-639-3 3-character language codes
///
public BookMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0)
{
if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
this.Title = title;
if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
this.Language = language;
if (_book0 == null) throw new ArgumentNullException(nameof(_book0));
_book0.BookMetadata.Add(this);
this.Publishers = new HashSet();
Init();
}
///
/// Static create function (for use in LINQ queries, etc.)
///
/// The title or name of the object
/// ISO-639-3 3-character language codes
///
public static BookMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0)
{
return new BookMetadata(title, language, dateadded, datemodified, _book0);
}
/*************************************************************************
* Properties
*************************************************************************/
///
/// Backing field for ISBN
///
protected long? _ISBN;
///
/// When provided in a partial class, allows value of ISBN to be changed before setting.
///
partial void SetISBN(long? oldValue, ref long? newValue);
///
/// When provided in a partial class, allows value of ISBN to be changed before returning.
///
partial void GetISBN(ref long? result);
public long? ISBN
{
get
{
long? value = _ISBN;
GetISBN(ref value);
return (_ISBN = value);
}
set
{
long? oldValue = _ISBN;
SetISBN(oldValue, ref value);
if (oldValue != value)
{
_ISBN = value;
}
}
}
/*************************************************************************
* Navigation properties
*************************************************************************/
[ForeignKey("Company_Publishers_Id")]
public virtual ICollection Publishers { get; protected set; }
}
}