using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Data.Entities
{
public partial class Chapter
{
partial void Init();
///
/// Default constructor. Protected due to required properties, but present because EF needs it.
///
protected Chapter()
{
Init();
}
///
/// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
///
public static Chapter CreateChapterUnsafe()
{
return new Chapter();
}
///
/// Public constructor with required data
///
/// ISO-639-3 3-character language codes
///
///
public Chapter(string language, long timestart, Release _release0)
{
if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
this.Language = language;
this.TimeStart = timestart;
if (_release0 == null) throw new ArgumentNullException(nameof(_release0));
_release0.Chapters.Add(this);
Init();
}
///
/// Static create function (for use in LINQ queries, etc.)
///
/// ISO-639-3 3-character language codes
///
///
public static Chapter Create(string language, long timestart, Release _release0)
{
return new Chapter(language, timestart, _release0);
}
/*************************************************************************
* Properties
*************************************************************************/
///
/// Backing field for Id
///
internal int _Id;
///
/// When provided in a partial class, allows value of Id to be changed before setting.
///
partial void SetId(int oldValue, ref int newValue);
///
/// When provided in a partial class, allows value of Id to be changed before returning.
///
partial void GetId(ref int result);
///
/// Identity, Indexed, Required
///
[Key]
[Required]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id
{
get
{
int value = _Id;
GetId(ref value);
return (_Id = value);
}
protected set
{
int oldValue = _Id;
SetId(oldValue, ref value);
if (oldValue != value)
{
_Id = value;
}
}
}
///
/// Backing field for Name
///
protected string _Name;
///
/// When provided in a partial class, allows value of Name to be changed before setting.
///
partial void SetName(string oldValue, ref string newValue);
///
/// When provided in a partial class, allows value of Name to be changed before returning.
///
partial void GetName(ref string result);
///
/// Max length = 1024
///
[MaxLength(1024)]
[StringLength(1024)]
public string Name
{
get
{
string value = _Name;
GetName(ref value);
return (_Name = value);
}
set
{
string oldValue = _Name;
SetName(oldValue, ref value);
if (oldValue != value)
{
_Name = value;
}
}
}
///
/// Backing field for Language
///
protected string _Language;
///
/// When provided in a partial class, allows value of Language to be changed before setting.
///
partial void SetLanguage(string oldValue, ref string newValue);
///
/// When provided in a partial class, allows value of Language to be changed before returning.
///
partial void GetLanguage(ref string result);
///
/// Required, Min length = 3, Max length = 3
/// ISO-639-3 3-character language codes
///
[Required]
[MinLength(3)]
[MaxLength(3)]
[StringLength(3)]
public string Language
{
get
{
string value = _Language;
GetLanguage(ref value);
return (_Language = value);
}
set
{
string oldValue = _Language;
SetLanguage(oldValue, ref value);
if (oldValue != value)
{
_Language = value;
}
}
}
///
/// Backing field for TimeStart
///
protected long _TimeStart;
///
/// When provided in a partial class, allows value of TimeStart to be changed before setting.
///
partial void SetTimeStart(long oldValue, ref long newValue);
///
/// When provided in a partial class, allows value of TimeStart to be changed before returning.
///
partial void GetTimeStart(ref long result);
///
/// Required
///
[Required]
public long TimeStart
{
get
{
long value = _TimeStart;
GetTimeStart(ref value);
return (_TimeStart = value);
}
set
{
long oldValue = _TimeStart;
SetTimeStart(oldValue, ref value);
if (oldValue != value)
{
_TimeStart = value;
}
}
}
///
/// Backing field for TimeEnd
///
protected long? _TimeEnd;
///
/// When provided in a partial class, allows value of TimeEnd to be changed before setting.
///
partial void SetTimeEnd(long? oldValue, ref long? newValue);
///
/// When provided in a partial class, allows value of TimeEnd to be changed before returning.
///
partial void GetTimeEnd(ref long? result);
public long? TimeEnd
{
get
{
long? value = _TimeEnd;
GetTimeEnd(ref value);
return (_TimeEnd = value);
}
set
{
long? oldValue = _TimeEnd;
SetTimeEnd(oldValue, ref value);
if (oldValue != value)
{
_TimeEnd = value;
}
}
}
///
/// Required, ConcurrenyToken
///
[ConcurrencyCheck]
[Required]
public uint RowVersion { get; set; }
public void OnSavingChanges()
{
RowVersion++;
}
/*************************************************************************
* Navigation properties
*************************************************************************/
}
}