Dans notre architecture ASP.NET MVC, nous avons la structure de routage suivante:contrôleurs multiples spécifiés dans une voie
http://localhost:80/Students/Details/2 - will give me details about student with id == 2, details include all the classes current student have.
http://localhost:80/Classes/Details/2 - will give me details about classes with id == 2, details include all the students current class have.
http://localhost:80/Schedule/Details/class=2&student=2 - will give me details about specific schedule for student with id=2 that has class with id=2
Cela fonctionne bien jusqu'à présent.
Maintenant, notre équipe est assez nouvelle sur asp.net mvc et nous avons pensé à rendre le routage un peu plus intuitif. Ainsi, au lieu de trois parcours séparés, nous aurons une longue route, quelque chose comme ceci:
http://localhost:80/Students/2/Classes/2/Homework/
et il fonctionnera comme:
http://localhost:80/Students/ - will give list of students
http://localhost:80/Students/2 - will give details about student 2
http://localhost:80/Students/2/Classes - will give all the classes for student with id 2
http://localhost:80/Students/2/Classes/2 - will give schedule for class with id 2 and student with id 2.
stoppez pas sûr si cela est/possible raisonnable, je voulais juste obtenir plus d'avis
merci qui m'a donné une idée sur où aller! – inside
super, heureux d'aider! – zed