-
Notifications
You must be signed in to change notification settings - Fork 42
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
Dump() does not print out public fields #23
Comments
Hi @dyster, this feature is actually available but is turned-off by default, so you need to enable it. DumpConfig.Default.MembersConfig.IncludeFields = true; Enabling it on per-dump basis: new Test().Dump(members: new MembersConfig { IncludeFields = true }); Btw, you can include nonpublic members as well, example: DumpConfig.Default.MembersConfig.IncludeNonePublicMembers = true; |
Yes I just branched the code to have a look and realised quickly there was a MembersConfig where I could set it. Which I just tried and no it does not print public fields by default, but that is (I think at least) how you are normally supposed to use structs? |
@dyster, sorry about the delay in my response. I agree with you that we should consider changing the default behavior with structs and once that is done, we should find a better way to separate the class/struct behaviors. I think the configuration model we have now is not ideal and I'm open for ideas on how to improve it |
if you create a public class with public fields like
public class MyClass { public uint MyNumber; }
and call Dump() on it you just get an empty table with the header
but if you change the fields to properties it will work, i.e
public class MyClass { public uint MyNumber { get; set; } }
The text was updated successfully, but these errors were encountered: