new ordering system added

This commit is contained in:
2024-09-29 23:00:32 +02:00
Unverified
parent 69937f13e6
commit 450e4a2f94
19 changed files with 275 additions and 59 deletions

View File

@@ -1,12 +1,22 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using WatchIt.Common.Query;
namespace WatchIt.Common.Model.Genres;
public class GenreResponse : Genre
public class GenreResponse : Genre, IQueryOrderable<GenreResponse>
{
#region PROPERTIES
[JsonIgnore]
public static IDictionary<string, Func<GenreResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<GenreResponse, IComparable>>
{
{ "id", x => x.Id },
{ "name", x => x.Name },
{ "description", x => x.Description }
};
[JsonPropertyName("id")]
public long Id { get; set; }