ritasker / CmdR

HTTP Command handler library for ASP.Net Core
MIT License
0 stars 0 forks source link

Model Binding #6

Open ritasker opened 5 years ago

ritasker commented 5 years ago

Request coming into a handler need a model to capture the request data. Data should be bound from:

Asp.Net Docs for binding precedence

ritasker commented 2 years ago

I think lower in the list higher the priority. eg

{
  "id": 123
}

would be overridden by /my-endpoint/246 were the route template is /my-endpoint/{id}.

ritasker commented 2 years ago

Does CmdR need to consider people using the [From*] attributes?

[FromBody]
[FromQuery]
[FromHeader]
ritasker commented 2 years ago

Or just use the TryParse / BindAsync methods. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis?view=aspnetcore-6.0#custom-binding