Class EnsuringMenuTransitionateToView
Decorator around the menu transition use case that ensures the target menu's visual instance
exists — building it lazily if needed — before delegating to the inner transition.
This keeps lazy-instantiation responsibility in the orchestration layer and out of the view:
Serenity.Menu.Infrastructure.Views only expresses the intent to transition.
Inherited Members
Namespace: Serenity.Menu.Application.UseCases
Assembly: Serenity.Menu.Application.dll
Syntax
public class EnsuringMenuTransitionateToView : ISyncUseCase<MenuTransitionateToViewInput>, IUseCase
Constructors
EnsuringMenuTransitionateToView(ISyncUseCase<MenuTransitionateToViewInput>, IMenuInstanceGate)
Initializes a new decorator wrapping inner and guarded by gate.
Declaration
public EnsuringMenuTransitionateToView(ISyncUseCase<MenuTransitionateToViewInput> inner, IMenuInstanceGate gate)
Parameters
| Type | Name | Description |
|---|---|---|
| ISyncUseCase<MenuTransitionateToViewInput> | inner | The inner menu transition use case to delegate to. |
| IMenuInstanceGate | gate | The menu instance gate that ensures the target view exists before showing it. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
Methods
Execute(MenuTransitionateToViewInput)
Ensures the target view exists, then runs the inner transition only if the instance is available.
If the gate returns false (a non-fatal build failure) the transition is aborted atomically,
leaving the current menu visible. Exceptions from the gate (fail-loud contexts) propagate.
Declaration
public void Execute(MenuTransitionateToViewInput input)
Parameters
| Type | Name | Description |
|---|---|---|
| MenuTransitionateToViewInput | input | The transition input carrying the source and target menu ids. |