Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save priyankakundu/0325499f5170181d2a626c77feab5d87 to your computer and use it in GitHub Desktop.
Save priyankakundu/0325499f5170181d2a626c77feab5d87 to your computer and use it in GitHub Desktop.
Web API
[FromQuery] attribute handles query parameters, i.e. key-value pairs coming after "?" in URI. [FromRoute] attribute handles
route parameters coming before "?" in URI, i.e. path parameters.
For example, if you configured route "orders/{id}", then "id" is your route parameter, and if some actual request is like
"orders/123?showHistory=true", then "showHistory" is your query parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment