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

Private fields marked with [DataMember] attribute are ignored during serialization/deserialization #51

Open
AdrianStrugala opened this issue Aug 30, 2021 · 0 comments
Labels
help wanted Extra attention is needed issue This doesn't seem right

Comments

@AdrianStrugala
Copy link
Owner

[DataMember] fields are resolved during schema generation.

There is no easy way (without significant performance hit) for serialization and deserialization of private fields.
If you feel, that this is your case - please leave a comment down below. Maybe we'll figure out the right solution.

Serialization code snippet

 var privateFields = type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
                    var targetField = privateFields.FirstOrDefault(f => f.Name.Contains(name));

                    value = targetField?.GetValue(recordObj);
@AdrianStrugala AdrianStrugala added the issue This doesn't seem right label Aug 30, 2021
@AdrianStrugala AdrianStrugala added the help wanted Extra attention is needed label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed issue This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant