Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when more than one [FromBody] #68

Open
JohanLarsson opened this issue Feb 4, 2019 · 0 comments
Open

Warn when more than one [FromBody] #68

JohanLarsson opened this issue Feb 4, 2019 · 0 comments
Labels

Comments

@JohanLarsson
Copy link
Collaborator

JohanLarsson commented Feb 4, 2019

// Don't do this. All of the following actions result in an exception.
[HttpPost]
public IActionResult Action1(Product product, 
                             Order order) => null;

[HttpPost]
public IActionResult Action2(Product product, 
                             [FromBody] Order order) => null;

[HttpPost]
public IActionResult Action3([FromBody] Product product, 
                             [FromBody] Order order) => null;

https://docs.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-2.2#binding-source-parameter-inference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant