dotnet / dotnet/aspnetcore

FromAnywhere or FromRequest model binder

Open
#58,053 0 comments 2 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

Sometimes an object is sent to the API in broken parts, some of its properties in the URL path, some as the query string, some as JSON post body.

We use a software product line, and it does that. Because it has centralized a lot of things. For example, it always sends the ID of the entity to be updated in the URL path. And it sends the `Key` property as a query string. And the `Title` and `Summary` go as JSON.

Please give us a model binder out of the box called `FromAnywhere` or `FromRequest`.

This binder would search for a given property in:

1. Route parameters
2. Query string
3. Form body

### Describe the solution you'd like

Right now we have implemented a custom model binder for this purpose. But it's messy. If we could get an official implementation it would be much better.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.