new ordering system added
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Common.Query;
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Common.Model.Photos;
|
||||
|
||||
public class PhotoResponse : Photo
|
||||
public class PhotoResponse : Photo, IQueryOrderable<PhotoResponse>
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonIgnore]
|
||||
public static IDictionary<string, Func<PhotoResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<PhotoResponse, IComparable>>
|
||||
{
|
||||
{ "id", x => x.Id },
|
||||
{ "media_id", x => x.MediaId },
|
||||
{ "mime_type", x => x.MimeType },
|
||||
{ "is_background", x => x.Background is not null },
|
||||
{ "is_universal_background", x => x.Background is not null && x.Background.IsUniversalBackground }
|
||||
};
|
||||
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user