SAIF.Framework.Web.Mvc overview¶
Documentation context: Packaged Component (NuGet)
SAIF.Framework.Web.Mvc is a presentation-tier framework library that sits between ASP.NET MVC 5 / Web API 2 and the SAIF core/data framework packages. It contains no application logic or entry point of its own; consuming Business Online applications inherit its controller base classes, apply its action filters, register its Autofac composition helper, and call its HTML helper extensions to render menus, web context, and other shared UI.
Purpose¶
- Provide reusable MVC building blocks — controller bases, action filters, model binders, and a fluent HTML/view-component framework — that consuming Business Online applications compose into their own controllers and views.
- Resolve, cache, and hand off a cross-application "web context" between requests and between applications, backed by session state and a remote WCF context service.
- Retrieve, cache, and render the Business Online navigation menu for the current user from an Oracle-backed NHibernate repository.
- Centralize cross-cutting request concerns: unhandled-exception logging/redirect (BR-11–BR-14) and role-based authorization (BR-15–BR-20).
- Bridge domain validation results into ASP.NET
ModelStateDictionaryand project them back out as JSON-friendly view models for grid and form error display. - Wire up the consuming application's dependency-injection container through a single Autofac registration entry point covering MVC/Web API discovery, NHibernate unit-of-work factories, and the menu/web-context services.
Responsibilities¶
- Own the request lifecycle hooks (
OnActionExecuting/OnActionExecuted) that resolve web context and decorate view models with context and menu data. - Own session-cache and WCF proxy logic for web context persistence and cross-application handoff.
- Own the query, filter, and mapping logic that turns Oracle-backed menu data into a
MenuViewModel. - Own server-side HTML emission for menus, web-context forms, labels, linked dropdowns, text counters, and a fluent toolbar component framework.
- Own the single composition entry point that registers MVC/Web API discovery, NHibernate unit-of-work factories, and menu/web-context/environment services into the consumer's Autofac container.
Key components¶
WebContextControllerBase/MenuControllerBase/ControllerBase: controller base chain providing web-context resolution and menu decoration for derived controllers.SaifAuthorizeAttribute/HandleExceptionAttribute: MVC action filters for authorization and unhandled-exception handling.WebContextService/WebContextServiceClient: session-cached, WCF-backed web context resolution and persistence.MenuService/Mappers: Oracle/NHibernate-backed retrieval and view-model mapping of the Business Online menu.AutofacExtensions: single Autofac composition entry point for consuming applications.- UI component framework (
ViewComponentBase,Toolbar,ToolbarBuilder,NavigationItem<T>) and HTML helper extensions (MenuExtensions,WebContextExtensions,LabelExtensions,LinkedDropdownHelper,TextCounterHelper,HtmlHelperExtensions). - View models (
SAIF.Web.Mvc.ViewModels): shared shapes for menu, web context, grid, and message rendering.
Related documentation¶
- Index
- Architecture
- Dependencies
- Configuration
- Operations and processes
- Business rules
- Security and authorization
- API reference
Sources¶
src/SAIF.Framework.Web.Mvc.csprojsrc/SAIF.Framework.Web.Mvc.nuspecREADME.md