Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldScale and Nullable does not return NULL if value should be NULL #234

Open
A016699 opened this issue May 31, 2024 · 0 comments
Open

Comments

@A016699
Copy link

A016699 commented May 31, 2024

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;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant