---
title: clsMenuPageCollection
summary: API reference for clsMenuPageCollection.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Menu
reference_type: package
---

# clsMenuPageCollection

`clsMenuPageCollection` is a BOF collection that retrieves all `clsMenuPage` records from the `MENU_PAGE` table.

## Purpose
- Return the full set of menu page records for use in menu tree construction and administrative management.

## Context
- Namespace: `SAIF.Business.Menu`
- Assembly/package: `SAIF.BOF.Business.Menu`

## Public members

| Member | Signature | Purpose |
| --- | --- | --- |
| `Item(inMenuPageSeqNum)` | `Default ReadOnly Property Item(ByVal inMenuPageSeqNum As Decimal) As clsMenuPage` | Returns the `clsMenuPage` matching the given sequence number, or `Nothing` if not found.* |
| `Item(inAppCode, inPageLink)` | `Default ReadOnly Property Item(ByVal inAppCode As String, ByVal inPageLink As String) As clsMenuPage` | Returns the page matching the application code and page link (strips query string; case-insensitive).* |
| `ItemExact(inAppCode, inPageLink)` | `ReadOnly Property ItemExact(ByVal inAppCode As String, ByVal inPageLink As String) As clsMenuPage` | Returns the page matching the exact application code and page link (case-insensitive, no query-string stripping).* |
| `CurrentItem` | `ReadOnly Property CurrentItem() As clsMenuPage` | Shadows base `CurrentItem`; returns the current item cast as `clsMenuPage`.* |
| `Add(inclsMenuPage)` | `Function Add(ByVal inclsMenuPage As clsMenuPage) As Integer` | Shadows base `Add`; appends a `clsMenuPage` to the collection.* |
| `Contains(inclsMenuPage)` | `Function Contains(ByVal inclsMenuPage As clsMenuPage) As Boolean` | Returns `True` if the collection contains the given object instance.* |
| `Contains(inMenuPageSeqNum)` | `Function Contains(ByVal inMenuPageSeqNum As Decimal) As Boolean` | Returns `True` if the collection contains a page matching the sequence number.* |
| `ContainsDeleted(inclsMenuPage)` | `Function ContainsDeleted(ByVal inclsMenuPage As clsMenuPage) As Boolean` | Returns `True` if the deleted-items list contains the given object instance.* |
| `ContainsDeleted(inMenuPageSeqNum)` | `Function ContainsDeleted(ByVal inMenuPageSeqNum As Decimal) As Boolean` | Returns `True` if the deleted-items list contains a page matching the sequence number.* |
| `Remove(inMenuPageSeqNum)` | `Sub Remove(ByVal inMenuPageSeqNum As Decimal)` | Removes the page matching the given sequence number from the collection.* |
| `Where(match)` | `Function Where(ByVal match As Predicate(Of clsMenuPage)) As clsMenuPageCollection` | Returns a filtered sub-collection of pages matching the predicate.* |
| `ToList` | `Function ToList() As List(Of clsMenuPage)` | Returns the collection contents as a generic `List(Of clsMenuPage)`.* |
| `NewMenuPages` | `Shared Function NewMenuPages(ByVal inDataportal As IDataPortalInfo) As clsMenuPageCollection` | Factory method; creates a new (empty) collection via the Data Portal.* |
| `GetAllMenuPages` | `Shared Function GetAllMenuPages(ByVal inDataportal As IDataPortalInfo) As clsMenuPageCollection` | Factory method; retrieves all `MENU_PAGE` records via the Data Portal.* |
| `Save` | `Function Save() As Boolean` | Calls `ApplyEdit()` then delegates to the base `Save()`; persists all dirty child items.* |

## Inherited public members

The members below come from the BOF collection framework (`clsBusinessCollectionBase`) that underpins `clsMenuPageCollection` through `clsBusinessCollection(Of T)`.

| Member | Signature | Purpose |
| --- | --- | --- |
| `MyGuid` | `Public ReadOnly Property MyGuid() As String` | Returns the collection's generated GUID identifier. |
| `ItemByGuid` | `Public ReadOnly Property ItemByGuid(ByVal inGuid As String) As clsBusinessBase` | Returns the child item with the matching framework GUID, if present. |
| `Rules` | `Public ReadOnly Property Rules() As clsRulesManager` | Exposes the collection-level rules manager. |
| `ErrorCount` | `Public ReadOnly Property ErrorCount() As Integer` | Returns the number of current validation errors. |
| `ErrorMessages` | `Public ReadOnly Property ErrorMessages() As String()` | Returns the current validation error messages. |
| `WarningCount` | `Public ReadOnly Property WarningCount() As Integer` | Returns the number of current warning messages. |
| `WarningMessages` | `Public ReadOnly Property WarningMessages() As String()` | Returns the current warning messages. |
| `InformationalCount` | `Public ReadOnly Property InformationalCount() As Integer` | Returns the number of informational validation messages. |
| `InformationalMessages` | `Public ReadOnly Property InformationalMessages() As String()` | Returns the current informational messages. |
| `ValidateAllChildren` | `Public Overridable Property ValidateAllChildren() As Boolean` | Controls whether validation checks every child before returning validity. |
| `IsDirty` | `Public ReadOnly Property IsDirty() As Boolean` | Indicates whether any active or deleted child has unsaved changes. |
| `IsValid` | `Public Overridable ReadOnly Property IsValid() As Boolean` | Validates the collection and its children and reports whether the collection is valid. |
| `BeginEdit` | `Public Sub BeginEdit()` | Starts a nested edit session for the collection and its children. |
| `CancelEdit` | `Public Sub CancelEdit()` | Cancels the current edit session and restores the prior snapshot. |
| `ApplyEdit` | `Public Sub ApplyEdit()` | Commits the current edit session for the collection and its children. |
| `Remove` | `Public Sub Remove(ByVal inChild As clsBusinessBase)` | Removes the supplied child business object from the collection. |
| `Item` | `Default Public ReadOnly Property Item(ByVal index As Integer) As clsBusinessBase` | Returns the child object at the specified zero-based index. |
| `Clone` | `Public Function Clone() As Object` | Creates a cloned copy of the collection. |
| `SaveChild` | `Public Overridable Function SaveChild() As Boolean` | Persists the collection when it is being managed as a child object. |
| `IsManaged` | `Public ReadOnly Property IsManaged() As Boolean` | Indicates whether the collection is operating in managed mode. |
| `IsFirst` | `Public ReadOnly Property IsFirst(ByVal inItem As clsBusinessBase) As Boolean` | Returns `True` when the supplied child is the first item in traversal order. |
| `First` | `Public Function First() As clsBusinessBase` | Moves traversal to the first item and returns it. |
| `FirstItem` | `Public ReadOnly Property FirstItem() As clsBusinessBase` | Returns the first item in the collection. |
| `Next` | `Public Function Next() As clsBusinessBase` | Advances traversal to the next item and returns it. |
| `IsNext` | `Public ReadOnly Property IsNext(ByVal inItem As clsBusinessBase) As Boolean` | Returns `True` when the supplied child is immediately after the current traversal position. |
| `NextItem` | `Public ReadOnly Property NextItem() As clsBusinessBase` | Returns the next item relative to the current traversal position. |
| `NextItem` | `Public ReadOnly Property NextItem(ByVal inRefPoint As clsBusinessBase) As clsBusinessBase` | Returns the item immediately after the supplied reference item. |
| `IsLast` | `Public ReadOnly Property IsLast(ByVal inItem As clsBusinessBase) As Boolean` | Returns `True` when the supplied child is the last item in traversal order. |
| `LastItem` | `Public ReadOnly Property LastItem() As clsBusinessBase` | Returns the last item in the collection. |
| `Last` | `Public Function Last() As clsBusinessBase` | Moves traversal to the last item and returns it. |
| `CurrentIndex` | `Public ReadOnly Property CurrentIndex() As Integer` | Returns the current traversal index. |
| `IsCurrent` | `Public ReadOnly Property IsCurrent(ByVal inItem As clsBusinessBase) As Boolean` | Returns `True` when the supplied child is the current traversal item. |
| `SetCurrent` | `Public Sub SetCurrent(ByRef inObject As clsBusinessBase)` | Sets the current traversal item by object reference. |
| `SetCurrent` | `Public Sub SetCurrent(ByVal inIndex As Integer)` | Sets the current traversal item by zero-based index. |
| `IndexOf` | `Public ReadOnly Property IndexOf(ByVal inObject As clsBusinessBase) As Integer` | Returns the index of the supplied child object. |
| `IsPrevious` | `Public ReadOnly Property IsPrevious(ByVal inItem As clsBusinessBase) As Boolean` | Returns `True` when the supplied child is immediately before the current traversal position. |
| `Previous` | `Public Function Previous() As clsBusinessBase` | Moves traversal to the previous item and returns it. |
| `PreviousItem` | `Public ReadOnly Property PreviousItem() As clsBusinessBase` | Returns the previous item relative to the current traversal position. |
| `PreviousItem` | `Public ReadOnly Property PreviousItem(ByVal inRefPoint As clsBusinessBase) As clsBusinessBase` | Returns the item immediately before the supplied reference item. |
| `XMLElementName` | `Public Property XMLElementName() As String` | Gets or sets the root element name used when emitting collection XML. |
| `XMLItemName` | `Public Property XMLItemName() As String` | Gets or sets the element name used for individual child items in XML output. |
| `GetReportXML` | `Public Function GetReportXML(ByVal inElementName As String) As String` | Generates report-oriented XML using the supplied root element name. |
| `GetReportXML` | `Public Function GetReportXML(Optional ByVal inFileStream As System.IO.StreamWriter = Nothing) As String` | Generates report-oriented XML and can optionally stream the output while building it. |
| `ToXML` | `Public Function ToXML() As String` | Serializes the collection to XML using the configured default names. |
| `ToXml` | `Public Function ToXml(ByVal inTagName As String) As String` | Serializes the collection to XML using the supplied root tag name. |

## Behavioral notes
- `BeforeRetrieve` executes [SQL-025](../../sql/SQL-025-saif-business-menu.md) with no parameters, returning all menu page rows.
- `AfterRetrieve` iterates an `IDataReader`, creates `clsMenuPage` child objects, and appends each to the collection.*

## Constraints and usage notes
- No server-side filtering is supported; callers filter the returned collection if needed.

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- `Legacy\BusinessObjectFramework\clsBusinessCollectionBase.vb`
- `Business\SAIF.Business.Menu\clsMenuPageCollection.vb`
