Server Error in '/' Application.

Sequence contains no matching element

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Sequence contains no matching element

Source Error:


Line 167:        {
Line 168:            lstbreadcrumbs.Add(pro_Category);
Line 169:            getCategoryBreadcrumbs(mainCategories.Single(n => n.Id == pro_Category.Parent && n.IsStatus == true));
Line 170:        }
Line 171:        else { lstbreadcrumbs.Add(pro_Category); }

Source File: c:\webspace\dongagroup.vn\httpdocs\danhmuc\category.aspx.cs    Line: 169

Stack Trace:


[InvalidOperationException: Sequence contains no matching element]
   System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +488
   danhmuc_category.getCategoryBreadcrumbs(proGetAllCategoryResult pro_Category) in c:\webspace\dongagroup.vn\httpdocs\danhmuc\category.aspx.cs:169
   danhmuc_category.Page_Load(Object sender, EventArgs e) in c:\webspace\dongagroup.vn\httpdocs\danhmuc\category.aspx.cs:46
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0