33 lines
977 B
C#
33 lines
977 B
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace View_by_Distance.Shared.Models;
|
|
|
|
public record class Sorting : Properties.ISorting
|
|
{
|
|
|
|
public int DaysDelta { init; get; }
|
|
public int DistancePermyriad { init; get; }
|
|
public int Id { init; get; }
|
|
public int NormalizedPixelPercentage { init; get; }
|
|
public bool Older { init; get; }
|
|
public int WithinRange { init; get; }
|
|
|
|
[JsonConstructor]
|
|
public Sorting(int daysDelta, int distancePermyriad, int id, int normalizedPixelPercentage, bool older, int withinRange)
|
|
{
|
|
DaysDelta = daysDelta;
|
|
DistancePermyriad = distancePermyriad;
|
|
Id = id;
|
|
NormalizedPixelPercentage = normalizedPixelPercentage;
|
|
Older = older;
|
|
WithinRange = withinRange;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
|
return result;
|
|
}
|
|
|
|
} |