// Kyoo - A portable and vast media library solution.
// Copyright (c) Kyoo.
//
// See AUTHORS.md and LICENSE file in the project root for full license information.
//
// Kyoo is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// Kyoo is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Kyoo. If not, see .
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 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 }; }
}
///
/// 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; }
}
}