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

How to serialize objects without SerializableAttribute? #2

Open
hasanbayatme opened this issue Jul 4, 2017 · 2 comments
Open

How to serialize objects without SerializableAttribute? #2

hasanbayatme opened this issue Jul 4, 2017 · 2 comments

Comments

@hasanbayatme
Copy link

I want to serialize some objects that don't have Serializable attribute, how can i bypass this rule?

Does this formatter supports surrogate serialization?

@rofr
Copy link
Member

rofr commented Jul 5, 2017

This IFormatter is a thin wrapper around NewtonSoft.JsonSerializer. The settings are optimized for use with OrigoDB. You could easily modify the code to accept types without SerializableAttribute:
https://github.com/DevrexLabs/Modules.JsonNetFormatter/blob/master/Modules.JsonNetFormatter/JsonNetFormatter.cs#L29

I suppose we could have the constructor accept an optional settings object, that would make it much more flexible. That would be a welcome contribution.

We have not done anything specific to support surrogates, so I'm guessing the answer is no.

@hasanbayatme
Copy link
Author

Thanks. understood. i will help you in my spare time.

Thanks again.

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