I'm working on a .NET core web API application, where I want the URL routing values into Model/FromBody parameter. If the routing property is exist in From body model.
Is there any generic solution for this, i.e will work for all model types.
We already found custom model binder, but it working for specific to model type. I'm looking for custom model binder which is working for all model types.
for example:
Action route: [Route("AH/{userId}")]
Url : ../AH/123
From body:
{
"userId":"",
"Value" : "Some value"
}
Now the routing value 123 needs to mapped to FromBody model property "userId"