Open jylaila opened 2 years ago
For all those who have same issue - try to add DefaultBreadcrumb attribute on your homepage action, e.g.:
[Route("/")]
public class HomeController : Controller
{
[DefaultBreadcrumb]
public IActionResult Index()
{
return View();
}
}
This should solve your problem with 'Sequence contains no matching element' error.
Thanks, madeyellow - now I have System.InvalidOperationException: 'Sequence contain more than one matching element' :D
Thanks, madeyellow - now I have System.InvalidOperationException: 'Sequence contain more than one matching element' :D
Most likely it's because you have more than one [DefaultBreadcrumb] attribute in project. Check all your controllers and ensure that you have only one DefaultBreadCrumb attribute, which is by the way should be action, that renders main (home) page. For all other actions you should use [Breadcrumb] attribute instead (as in your original post from 17 March).
Thanks (I'm not the OP though!) Fixed my issue anyway - was mixing Razor pages with controllers'n'views in my project, so cleared up that extra cruft and it's OK now.
This is my class in razor
[Breadcrumb("createdrequests")] public partial class CreatedRequests { }
and I´m having this issue: System.InvalidOperationException: 'Sequence contains no matching element'