Try Catch on Serialize
Better Relation Data
This commit is contained in:
35
Adaptation/FileHandlers/json/WIQL/Relation.cs
Normal file
35
Adaptation/FileHandlers/json/WIQL/Relation.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.json.WIQL;
|
||||
|
||||
internal class Relation
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Relation(string rel,
|
||||
string url,
|
||||
Attribute attributes)
|
||||
{
|
||||
Rel = rel;
|
||||
Rel = rel;
|
||||
URL = url;
|
||||
Attributes = attributes;
|
||||
}
|
||||
|
||||
[JsonPropertyName("attributes")] public Attribute Attributes { get; set; }
|
||||
[JsonPropertyName("rel")] public string Rel { get; set; }
|
||||
[JsonPropertyName("url")] public string URL { get; set; }
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Relation))]
|
||||
internal partial class WIQLRelationSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Relation[]))]
|
||||
internal partial class WIQLRelationCollectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user