8.1.3.4 Highlighting the Current Category; Listing 8-9 Using the View Bag Feature in the NavController.cs File
This commit is contained in:
parent
4eaf23bc64
commit
32fa22777d
@ -16,8 +16,10 @@ namespace SportsStore.WebUI.Controllers
|
||||
repository = repo;
|
||||
}
|
||||
|
||||
public PartialViewResult Menu()
|
||||
public PartialViewResult Menu(string category = null)
|
||||
{
|
||||
ViewBag.SelectedCategory = category;
|
||||
|
||||
IEnumerable<string> categories = repository.Products
|
||||
.Select(x => x.Category)
|
||||
.Distinct()
|
||||
|
Loading…
x
Reference in New Issue
Block a user