string enum converter for AddressType and Type

This commit is contained in:
Pilzinsel64
2024-08-30 13:10:36 +02:00
parent 61a45b0e6a
commit 99af44b820

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Pilz.Updating; namespace Pilz.Updating;
@@ -8,9 +9,10 @@ public class UpdatePackageInfo(AppVersion version, string address)
public AppVersion Version { get; set; } = version; public AppVersion Version { get; set; } = version;
public UpdateNotes Notes { get; } = new(); public UpdateNotes Notes { get; } = new();
public string Address { get; set; } = address; public string Address { get; set; } = address;
[JsonConverter(typeof(StringEnumConverter))]
public PackageAddressType AddressType { get; set; } public PackageAddressType AddressType { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public PackageType Type { get; set; } public PackageType Type { get; set; }
[Obsolete, JsonProperty] [Obsolete, JsonProperty]
private string Packagelink => Address; private string Packagelink => Address;
} }