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

Modify the behaviour of "Specified"-properties to include empty not null collections #490

Closed
Stahhl opened this issue Feb 19, 2024 · 2 comments

Comments

@Stahhl
Copy link

Stahhl commented Feb 19, 2024

Hello if this is just me failing to RTFM let me know.

Is it possible to modify the generated "Specified"-properties to include empty not null collections in the serialized xml output?

From this:

[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FoosSpecified
{
    get
    {
        return ((this.Foos != null)
                    && (this.Foos.Count != 0));
    }
}

To this:

[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FoosSpecified
{
    get
    {
        return this.Foos != null;
    }
}

I want the end result to look like this:

<Response>
  <Foos />
</Response>
@mganss mganss closed this as completed in bbef9ea Feb 19, 2024
@mganss
Copy link
Owner

mganss commented Feb 19, 2024

I've added the ec configuration option in 2.1.1107.

@Stahhl
Copy link
Author

Stahhl commented Feb 19, 2024

Thanks for the amazingly quick response! @mganss 🥇🏆

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

2 participants