---
title: Map the menu contract to view models
summary: Project the menu contract object onto MVC view models for rendering.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
operation_id: OP-13
trigger: OP-11 (build and attach the Business Online menu) step 3
---

# 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.

```mermaid
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.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **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`
