We can now return to the
EventController class and flesh out the
Index action method and the associated view. Our goal is to display a table of event and ranking information, with links so that the user can edit or delete existing records or add new ones. We also need to allow the user to filter the set of events that are displayed based on the event type.
To begin, we need a view model object. I want to pass all the information needed for each row in the table in a single object, which means we need something to convey an
Event domain model object and two values representing the personal rank and the reference rank. I created a new folder,
Models/View, and added a new class called
EventAndRankSummary. Listing 31-19 shows ...