using System;
using System.Linq.Expressions;
using Kyoo.Abstractions.Models.Attributes;
namespace Kyoo.Abstractions.Models
{
///
/// ID and link of an item on an external provider.
///
public class MetadataID
{
///
/// The ID of the resource which possess the metadata.
///
[SerializeIgnore] public int ResourceID { get; set; }
///
/// The ID of the provider.
///
[SerializeIgnore] public int ProviderID { get; set; }
///
/// The provider that can do something with this ID.
///
public Provider Provider { get; set; }
///
/// The ID of the resource on the external provider.
///
public string DataID { get; set; }
///
/// The URL of the resource on the external provider.
///
public string Link { get; set; }
///
/// The expression to retrieve the unique ID of a MetadataID. This is an aggregate of the two resources IDs.
///
public static Expression> PrimaryKey
{
get { return x => new { First = x.ResourceID, Second = x.ProviderID }; }
}
}
}