Support multiple [FromRoute], [FromHeader], [FromBody], etc in a single object #4869
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Milestone
I'm trying to create an object with all the relevant data from a request bound.
Imagine an action like this
And the model could be like this
Unfortunately multiple
[FromBody]
isn't allowed.If it was allowed and worked as expected I could implement a generic CRUD controller like so
Obviously it wouldn't look exactly like that.
The idea is to remove all logic from the controller that isn't API/MVC related. So all the controller does is
Now I can have one implementation for all my CRUD controller needs - and there was much rejoicing!
It doesn't need to be
[FromBody]
it could be another attribute. Like[FromBodyPart]
,[BindFromBody]
or something completely different.Would that be feasible?
The text was updated successfully, but these errors were encountered: