Skip to content

Map the menu contract to view models

Project the menu contract object onto MVC view models for rendering. Trigger: OP-11 (build and attach the Business Online menu) step 3.

Field Value
Operation ID OP-13
Trigger OP-11 (build and attach the Business Online menu) step 3
Inputs BusinessOnlineMenu
Outputs MenuViewModel with Favorites and Items
Primary components Mappers.MapMenuViewModel(BusinessOnlineMenu)
Entry point src/Web.Mvc/Classes/Mappers.cs

Steps

  1. Project bolMenu.Favorites and bolMenu.Items through the private MapMenuItems, copying ApplicationName, FavoriteName, MenuCategory, MenuCategoryCode, PageId, PageLink, PageName, and Tooltip onto MenuItemViewModel.
  2. The projection is a lazy Select with no materialization, so enumeration happens at render time.*

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([BusinessOnlineMenu])
    Map[Project Favorites and Items]
    EndOk([MenuViewModel])
    Start --> Map
    Map --> EndOk

Failure and edge-case behavior

  • No unexpected failure paths beyond argument-guard exceptions and delegated dependency behavior were identified for this operation.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • src/Web.Mvc/Classes/Mappers.cs