using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Data.Entities
{
public partial class MediaFileStream
{
partial void Init();
///
/// Default constructor. Protected due to required properties, but present because EF needs it.
///
protected MediaFileStream()
{
Init();
}
///
/// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
///
public static MediaFileStream CreateMediaFileStreamUnsafe()
{
return new MediaFileStream();
}
///
/// Public constructor with required data
///
///
///
public MediaFileStream(int streamnumber, MediaFile _mediafile0)
{
this.StreamNumber = streamnumber;
if (_mediafile0 == null) throw new ArgumentNullException(nameof(_mediafile0));
_mediafile0.MediaFileStreams.Add(this);
Init();
}
///
/// Static create function (for use in LINQ queries, etc.)
///
///
///
public static MediaFileStream Create(int streamnumber, MediaFile _mediafile0)
{
return new MediaFileStream(streamnumber, _mediafile0);
}
/*************************************************************************
* 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 StreamNumber
///
protected int _StreamNumber;
///
/// When provided in a partial class, allows value of StreamNumber to be changed before setting.
///
partial void SetStreamNumber(int oldValue, ref int newValue);
///
/// When provided in a partial class, allows value of StreamNumber to be changed before returning.
///
partial void GetStreamNumber(ref int result);
///
/// Required
///
[Required]
public int StreamNumber
{
get
{
int value = _StreamNumber;
GetStreamNumber(ref value);
return (_StreamNumber = value);
}
set
{
int oldValue = _StreamNumber;
SetStreamNumber(oldValue, ref value);
if (oldValue != value)
{
_StreamNumber = value;
}
}
}
///
/// Required, ConcurrenyToken
///
[ConcurrencyCheck]
[Required]
public uint RowVersion { get; set; }
public void OnSavingChanges()
{
RowVersion++;
}
/*************************************************************************
* Navigation properties
*************************************************************************/
}
}