Merge branch 'dev' into j3/TODO_erreurs
This commit is contained in:
@@ -7,6 +7,37 @@ public static class RouteConfiguration
|
||||
/// </summary>
|
||||
public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints)
|
||||
{
|
||||
// ----------- TITRE -----------
|
||||
endpoints.MapControllerRoute(
|
||||
name: "TitreStyle",
|
||||
pattern: "titres/style/{style}",
|
||||
defaults: new { controller = "Titre", action = "Style" });
|
||||
|
||||
endpoints.MapControllerRoute(
|
||||
name: "TitreIndex",
|
||||
pattern: "titre/{id}",
|
||||
defaults: new { controller = "Titre", action = "Index" });
|
||||
|
||||
endpoints.MapControllerRoute(
|
||||
name: "ArtisteIndex",
|
||||
pattern: "artiste/{nom}",
|
||||
defaults: new { controller = "Artiste", action = "Index" });
|
||||
|
||||
// ----------- ADMIN -----------
|
||||
var adminRoutes = new Dictionary<string, string>
|
||||
{
|
||||
{ "artistes", "Artiste" }, { "commentaires", "Commentaire" }, { "styles", "Style" }, { "titres", "Titre" },
|
||||
};
|
||||
|
||||
foreach (var route in adminRoutes)
|
||||
{
|
||||
endpoints.MapControllerRoute(
|
||||
name: $"Admin{route.Value}Index",
|
||||
pattern: $"administration/{route.Key}",
|
||||
defaults: new { area = "Administration", controller = route.Value, action = "Index" });
|
||||
}
|
||||
|
||||
// --- AUTRE PROUTES ---
|
||||
endpoints.MapControllerRoute(
|
||||
name: "areas",
|
||||
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
Reference in New Issue
Block a user