i need to accept a json string that contains fields which are of type uint32[] (with length of 2) to a long.
class to be serialized to:
public class ChainHeightDTO
{
[JsonProperty("height")]
public uint[] Height { get; set; }
}
what i need:
public class ChainHeightDTO
{
[JsonProperty("height")]
[JsonConverter(typeof(TypeConversionClass))]
public long Height { get; set; }
}
ive seen this answer: https://stackoverflow.com/a/4093750/8099383 which looks like what i need but i need to include a custom function to convert from uint32[] to long (i think?), and it seems this works in relation to interfaces rather than native types.
in case it makes a difference, the long is made up of uint32[0] = lower & uint32[1] = higher.