How can I somehow pull the previous route ID to filter on my current page? I am going from a MediaDetails page to a GenreDetails page. The MediaDetails page sends me over to GenreDetails where I can list movies by genre. I would like to filter with C-linq to only have movies by genre for the given media that I cliked on.
So for instance
I click DVD - which has an ID of 1
I see all the Genres - which includes "Talk Show" for instance.
I click "Talk-Show" and only Talks Shows of Media Type 1 appear.
Please let me know if I need to explain this a little better. I know it should be fairly straightforward, just don't know how to get it.
The razor code is below...I just need to figure out that PREVIOUSID part of the code.
@foreach (var item in @Model.Movies.Where(x => x.MediaTypeID == **PREVIOUSID**))
{
<tr>
<td class="col-sm-10">
@Html.DisplayFor(Model => item.MovieTitle)
</td>
<td class="col-sm-10">
@Html.DisplayFor(Model => item.MovieYear)
</td>
</tr>
}
EDIT: And actually I suppose it may be slightly more challenging because I need the id from 2 routes ago since I follow this path:
Media ID (what I want)
Media Details -which lists Genres
Genre Details - which lists all the movies in that genre.
I am also using a version of ASP.Net Core which does not contain a definition for RequestContext.