zHaytam / SmartBreadcrumbs

A utility library for ASP.NET Core (both MVC and Razor Pages) websites to easily add and customize breadcrumbs.
https://blog.zhaytam.com/2018/06/24/asp-net-core-using-smartbreadcrumbs/
MIT License
161 stars 77 forks source link

ASP.NET Core 6 MVC action return ActionResult<T>breadcrumb will not be generated automatically #104

Open ruyut opened 1 year ago

ruyut commented 1 year ago

If action return IActionResult, breadcrumb will be generated automatically. but if action return ActionResult<T>, breadcrumb will not be generated automatically.

I create a test project on this github repository

test code(in my test repository):

private List<string> _list = new List<string> { "a", "b", "c" };

[Breadcrumb("Page2", FromAction = nameof(Page1))]
public IActionResult Page2()
{
    ViewData["Title"] = "Page2";
    return View(_list);
}

[Breadcrumb("Page3", FromAction = nameof(Page1))]
public ActionResult<List<string>> Page3()
{
    ViewData["Title"] = "Page3 - Can't get the breadcrumb to work";

    return View(_list);
}

asp.net core mvc 6.0 dotnet version: 6.0.402 SmartBreadcrumbs version: 3.6.1