mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use source generator for statistics upload JSON serializing.
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace Aaru.CommonTypes.Metadata;
|
namespace Aaru.CommonTypes.Metadata;
|
||||||
@@ -83,6 +84,12 @@ public class Stats
|
|||||||
public VerifyStats Verify { get; set; }
|
public VerifyStats Verify { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||||
|
IncludeFields = true)]
|
||||||
|
[JsonSerializable(typeof(StatsDto))]
|
||||||
|
// ReSharper disable once PartialTypeWithSinglePart
|
||||||
|
public partial class StatsDtoContext : JsonSerializerContext {}
|
||||||
|
|
||||||
/// <summary>DTO for statistics</summary>
|
/// <summary>DTO for statistics</summary>
|
||||||
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
||||||
public class StatsDto
|
public class StatsDto
|
||||||
|
|||||||
Reference in New Issue
Block a user