I am trying to achieve a particular url patterns that I find clean and readable Am trying to construct a url like this
/students/updatestudent/29/20c52772-9362-470a-aed1-87a92fd28a11/
I want t capture the student ID and the student UUID and pass them to the action. Here is how the action looks like.
public IActionResult UpdateStudent(int Id, string uuid){
}
Here are my MapControllerRoute
endpoints.MapControllerRoute(
name:"studentsupdate",
pattern: "{controller=Students}/{action=UpdateStudent}/{Id}/{uuid}/",
defaults: new { controller = "Students", action = "UpdateStudent", Id = "", uuid = "" }
);
When I try the following;
<a href='@Url.Action("UpdateStudent", "studentsupdate", new { Id = student.Id, uuid=student.UniqueUUID })/' class="a--color2">
I get the following;
https://localhost:44361/Students/UpdateStudent/29?uuid=20c52772-9362-470a-aed1-87a92fd28a11/
Instead of
https://localhost:44361/Students/UpdateStudent/29/20c52772-9362-470a-aed1-87a92fd28a11/