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

DumpifySettings class? #24

Open
dyster opened this issue Feb 24, 2024 · 2 comments
Open

DumpifySettings class? #24

dyster opened this issue Feb 24, 2024 · 2 comments
Assignees
Labels
discussion question Further information is requested

Comments

@dyster
Copy link

dyster commented Feb 24, 2024

Having just tested the MembersConfig options, i ended up with
myObject.Dump(null, null, null, null, null, null, membersConfig);
Would Dump benefit by a DumpifySettings class similar to XmlSettings and others used in .NET?

Yes I know there is the global setting =)

@MoaidHathot
Copy link
Owner

MoaidHathot commented Feb 24, 2024

You can use named-parameters :)

myObject.Dump(members: membersConfig);

Having said that, I'm rethinking the current strategy for customizing the Dumps. It isn't ideal to say the least.

@dyster
Copy link
Author

dyster commented Feb 24, 2024

That's hilarious, I remember when they introduced named parameters like 15 years ago but I didn't really understand what it was for when I read it in the release notes and never gave it a second thought. And here we are, I finally figured it out haha.

I don't know if the Microsoft serializers way of having a SettingsObject is the best way of doing it, but once you get used to it you are used to it, and when some nuget I just got is also using a settings object of some sort I hardly ever think twice about it, so I think it makes sense from that perspective.

I think one thing I like about the settings object is that without having to browse code or look online, you can just instantiate it and inspect what all the default values are.

@MoaidHathot MoaidHathot self-assigned this Feb 24, 2024
@MoaidHathot MoaidHathot added question Further information is requested discussion labels Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants