billbogaiv / hybrid-model-binding

Provides the ability to bind models using both ModelBinder and ValueProvider in ASP.NET Core.
MIT License
104 stars 19 forks source link

Hi .. I used your hybrid with .net core 2.0 it does not read from request body which is sent as Json object . may i know the reason . 0.4.0 version #32

Closed billbogaiv closed 4 years ago

billbogaiv commented 5 years ago

Hi .. I used your hybrid with .net core 2.0 it does not read from request body which is sent as Json object . may i know the reason . 0.4.0 version

Originally posted by @vinayakshettar in https://github.com/billbogaiv/hybrid-model-binding/pull/29#issuecomment-493030407

vinayakshettar commented 5 years ago

Hi Just hybrid-model-binding latest version still it does not read Json Body and bind to model .Please let me know if i am missing anything

billbogaiv commented 5 years ago

Make sure you're using the latest-version: https://www.nuget.org/packages/HybridModelBinding/0.15.0

I'm not able to reproduce any issues on my end. Try modifying the same project and change the DefaultController to be [HttpPost]: https://github.com/billbogaiv/hybrid-model-binding/blob/d05f3782d7e0a1cb23a1a976e29fa2648095f475/samples/AspNetCoreWebApplication/Controllers/DefaultController.cs#L8. Then, using something like Postman, submit a request like:

⚠️ replace with your port-number if different

POST http://localhost:12512
{
    "name": "vinayakshettar"
}

The response will be:

<h3>Age: N/A</h3>
<h3>Name: vinayakshettar</h3>
billbogaiv commented 5 years ago

This comment from another issue may provide insight into your problems of data not binding correctly: https://github.com/billbogaiv/hybrid-model-binding/issues/34#issuecomment-495040849

billbogaiv commented 4 years ago

Closing due to inactivity.