CarterCommunity / Carter

Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable.
MIT License
2.06k stars 174 forks source link

Alternate binder #225

Closed gkinsman closed 4 years ago

gkinsman commented 4 years ago

This PR adds a new IModelBinder interface that allows substitution of an alternative model binding mechanism.

The default binder uses System.Text.Json, but has some shortcomings such as that it cannot bind properties with private setters.

This PR also implements a model binder that uses Newtonsoft.Json for backwards compatibility. It doesn't come out of the box, but is in the tests.

jchannon commented 4 years ago

Thanks! 👍