I'm just want use the FieldScale ans SerializeWhen Atribuest together with Nullable type.
If the FieldScale is not use the Deserializion works correctly as it returns null if the SerializeWhen is not valid. If i add the Fieldscale it returns 0 instead of NULL.
As a second problem was that if you using float? it throws an Exception - as ist could not be converted.
public class ScaledValueClass
{
[Ignore]
public bool Serialize { get; set; } = false;
[FieldScale(2)]
[SerializeAs(SerializedType.Int4)]
[SerializeWhen(nameof(Serialize), true)]
public double? Value { get; set; } = default;
}
I'm just want use the FieldScale ans SerializeWhen Atribuest together with Nullable type.
If the FieldScale is not use the Deserializion works correctly as it returns null if the SerializeWhen is not valid. If i add the Fieldscale it returns 0 instead of NULL.
As a second problem was that if you using float? it throws an Exception - as ist could not be converted.