---
title: Resolve an application by virtual path
summary: Resolves the application code that owns the current request's virtual path; the returned code is used as the application context for all subsequent authorization lookups in the session.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Business.Menu
reference_type: package
operation_id: OP-MENU-04
trigger: "`NavigationContext` resolving the current application from the request's virtual path"
---

# Resolve an application by virtual path

Resolves the application code that owns the current request's virtual path; the returned code is used as the application context for all subsequent authorization lookups in the session.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-MENU-04 |
| **Trigger** | `NavigationContext` resolving the current application from the request's virtual path |
| **Inputs** | Requested virtual path |
| **Outputs** | The matching `clsApplicationCode`, or `Nothing` |
| **Primary components** | `clsApplicationCodeCollection.ItemByAppPath` |
| **Entry point** | `SAIF.Business.Menu/clsApplicationCodeCollection.vb` |

## Steps

1. Filter the collection where `ApplicationPath.Trim.ToUpper` equals the supplied path upper-cased and trimmed. ([BR-MENU-012](../business-rules.md#br-menu-012-application-resolution-by-virtual-path); table [BUSONLINE_APPS_CODE](../database-tables.md#busonline_apps_code))
2. Return the first match or `Nothing`.
   - If a match is found: callers (the MVC `NavigationContext`) use the returned `Code` as the application code for all subsequent authorization lookups.
   - If no match: navigation context resolution fails for the request.

## Process flow

```mermaid
flowchart TD
    Start([Request virtual path]) --> Filter[Filter ApplicationCodeCollection by trimmed, upper-cased path]
    Filter --> Found{Match found?}
    Found -->|Yes| Return([Return application Code])
    Found -->|No| Nothing([Return Nothing])
```

## Failure and edge-case behavior
- No matching application path: `Nothing` is returned and the caller cannot establish an application context for the request.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- SAIF.Business.Menu/clsApplicationCodeCollection.vb
