#152 routage recherche mis a jour et géré dans RouteConfiguration.cs
This commit is contained in:
@@ -10,7 +10,6 @@ namespace Webzine.WebApplication.Controllers
|
|||||||
using Webzine.WebApplication.ViewModels.Recherche;
|
using Webzine.WebApplication.ViewModels.Recherche;
|
||||||
using Webzine.WebApplication.ViewModels.Titre;
|
using Webzine.WebApplication.ViewModels.Titre;
|
||||||
|
|
||||||
[Route("recherche")]
|
|
||||||
public class RechercheController : Controller
|
public class RechercheController : Controller
|
||||||
{
|
{
|
||||||
private readonly ILogger<RechercheController> logger;
|
private readonly ILogger<RechercheController> logger;
|
||||||
@@ -22,7 +21,7 @@ namespace Webzine.WebApplication.Controllers
|
|||||||
this.titreRepository = titreRepository;
|
this.titreRepository = titreRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("")]
|
[HttpPost]
|
||||||
public IActionResult Index(string mot)
|
public IActionResult Index(string mot)
|
||||||
{
|
{
|
||||||
this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot);
|
this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot);
|
||||||
|
|||||||
@@ -8,10 +8,17 @@ public static class RouteConfiguration
|
|||||||
public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints)
|
public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// ----------- RECHERCHE -----------
|
||||||
|
// exemple : /artiste/boblechanteurtarpingénial
|
||||||
|
endpoints.MapControllerRoute(
|
||||||
|
name: "rechercheIndex",
|
||||||
|
pattern: "recherche",
|
||||||
|
defaults: new { controller = "Recherche", action = "Index" });
|
||||||
|
|
||||||
// ----------- ARTISTE -----------
|
// ----------- ARTISTE -----------
|
||||||
// exemple : /artiste/boblechanteurtarpingénial
|
// exemple : /artiste/boblechanteurtarpingénial
|
||||||
endpoints.MapControllerRoute(
|
endpoints.MapControllerRoute(
|
||||||
name: "TitreDetails",
|
name: "ArtisteIndex",
|
||||||
pattern: "artiste/{nom}",
|
pattern: "artiste/{nom}",
|
||||||
defaults: new { controller = "Artiste", action = "Index" });
|
defaults: new { controller = "Artiste", action = "Index" });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user