Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I want to create a controller route to get details for an object with given id.
I know how to create a route like /data?id=15, but I would prefer the route to be /data/15.
How do I do that?
Thanks in advance Paul
[HttpGet] [Route("data/{id}")] public IActionResult Get([FromRoute(Name="id")] int id) { ... }
Add a comment