zerenaksu / Cat_Web_App

MVC app practice
0 stars 1 forks source link

Task 05: Consolidate controller actions into a single action #7

Open sayedihashimi opened 6 years ago

sayedihashimi commented 6 years ago

In the previous task we created a separate controller action, and view, for each category. In this task we want to consolidate that into a single controller action. The views will still be separate, but we will consolidate that in the next task.

The work needed includes:

Sample of new controller action

public IActionResult Category(string category){
    return View(category);
}

Sample of an updated link

<a asp-controller="Home" asp-action="Category" asp-route-category="hats">hats</a>

Learning resources

sayedihashimi commented 6 years ago

I believe the only work needed for this task is to convert @Html.ActionLink to use the new aspnet TagHelpers (i.e. <a asp-controller="Home" asp-action="Category" asp-route-category="hats">hats</a>).

sayedihashimi commented 6 years ago

It doesn’t look like all the work is complete here. I’m still seeing “@Html.ActionLink” in the Index view.

zerenaksu commented 6 years ago

Sorry I had not yet pushed the changes, that's why.

zerenaksu commented 6 years ago

It should be all set now. version control in vsmac is still not working for me, so I just used the command line. I commented out the old lines in the code.