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

Add support for JsonSerializationSettings #56

Open
Cherepoc opened this issue Mar 15, 2018 · 6 comments
Open

Add support for JsonSerializationSettings #56

Cherepoc opened this issue Mar 15, 2018 · 6 comments

Comments

@Cherepoc
Copy link

Hello!
Currently there's no straightforward way to customize json serialization process for this package. Can you add it?
Thank you!

@davidyack
Copy link
Owner

Can you elaborate on the scenario you are trying to solve?

@Cherepoc
Copy link
Author

Shure! The crm project I'm working in has really badly named fields, and I want my dto objects to have nicer names. Also I want the dtos clients get using the library to serialize to json normally, so using JsonProperty or other standart attributes is out of the question. I figured out I could write custom attributes and contract resolver, but I need to supply that in serialization settings.
Hope that makes sence. Thanks!

@davidyack
Copy link
Owner

ok I see, now I didn't look to hard at this, but take a look at http://blog.maskalik.com/asp-net/json-net-implement-custom-serialization/ - I believe Get<> and GetList<> would let you provide your own class, if you attribute it as this blog post indicated it looks like it would let your custom serializer do the work - disclaimer I didn't dig in too deep on the article - let me know if that gets you toward what you are trying to accomplish

@Cherepoc
Copy link
Author

That won't do - it's the same as using JsonProperty attributes. I want to have a special kind of json serialization just for the crm, and let the classes work normally with other json serialization cases, but decorating property or a class with json attributes will apply them globally.

@davidyack
Copy link
Owner

So what changes to the API would you like to see?

@Cherepoc
Copy link
Author

I think API-wise the best thing will be ability to set JsonSerializationSettings for CRMWebAPI object.

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