using System; using System.Linq.Expressions; using Kyoo.Models.Attributes; namespace Kyoo.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 name of the resource type. This is only used internally to discriminate types. /// [SerializeIgnore] public string ResourceType { 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, Type = x.ResourceType}; } } } }