Files
WatchIt/WatchIt.Common/WatchIt.Common.Model/Genders/GenderResponse.cs

35 lines
783 B
C#
Raw Normal View History

2024-10-02 16:09:11 +02:00
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
2024-10-05 09:12:28 +02:00
using WatchIt.Common.Query;
2024-10-02 16:09:11 +02:00
namespace WatchIt.Common.Model.Genders;
2024-10-05 09:12:28 +02:00
public class GenderResponse : Gender, IQueryOrderable<GenderResponse>
2024-10-02 16:09:11 +02:00
{
#region PROPERTIES
2024-10-05 09:12:28 +02:00
[JsonIgnore]
public static IDictionary<string, Func<GenderResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<GenderResponse, IComparable>>
{
{ "name", item => item.Name }
};
2024-10-02 16:09:11 +02:00
[JsonPropertyName("id")]
public required short? Id { get; set; }
#endregion
#region CONSTRUCTORS
[SetsRequiredMembers]
public GenderResponse(Database.Model.Common.Gender gender)
{
Id = gender.Id;
Name = gender.Name;
}
#endregion
}