ASP.NET Core Blazor Server Application Life Cycle
- 3 minutes to read
The following table outlines the main stages in the life cycle of an XAF Blazor application:
| Stage | Description |
|---|---|
| Host Startup | The application host starts. At this stage, the system does not create any XAF Application instances, does not access the database, and does not initialize the application model. |
| Web API Initialization | If the application includes a Web API service, the system creates an application instance to build the entity data model (EDM) and initialize singleton services such as ITypesInfo. This instance is destroyed after initialization. - In Integrated mode, the created application is a descendant of the BlazorApplication class. You can use settings of this class, including the builder.AddBuildStep method, to customize the application. - In Standalone mode, the created application is a WarmUpApplication class instance with customization limited to the builder.AddBuildStep method. |
| User Connects to the Server | The system establishes a SignalR hub connection. The ProxyHubConnectionHandler initializes the ValueManager storage container for the user session.To customize this stage, modify the following file: SolutionName.Blazor.Server/Services/ProxyHubConnectionHandler.cs. Note that Azure SignalR Service requires you to set up the ProxyHubConnectionHandler in the Startup.cs file. Refer to the following help topic for more information: Azure Deployment. |
| Creation of Circuit | The CircuitHandlerProxy initializes required circuit services.To customize this stage, implement an ICircuitHandler and register it in the SolutionName.Blazor.Server\Startup.cs file:services.TryAddEnumerable(ServiceDescriptor.Scoped<ICircuitHandler,CircuitHandlerCustomizer>()); |
| Logon Form Display | The system creates an application instance for the logon form. After authentication, this instance is destroyed and the system creates a new application instance for the authenticated user. For more information, review the following help topic: Customize the Logon Window Appearance And Behavior. |
| User Authenticated | The user is authenticated according to the configured authentication scheme. Refer to the following help topic to learn how to customize the current stage of the workflow: Customize Standard Authentication Behavior and Supply Additional Logon Parameters (.NET Applications). |
| Startup Popup Actions | Startup popup actions (such as ChangePasswordOnLogon) are executed. These actions are registered in modules and are shown after authentication. Override the GetStartupActions method in your module to modify the collection of startup actions. |
| Main Window Display | The application creates a Show View Strategy instance that displays the main window. You can use the GetStartupActions method to modify the default form creation process or display custom startup Views as described in the following KB article: How to show a specific View at application startup, right after the logon window or after loading the main window |
| Circuit Closed | The circuit is closed. |
| Application Disposed | The application instance is disposed when the Blazor application is closed (for instance, the browser or a tab is closed). If the client disconnects unexpectedly, the server waits one minute for reconnection. If the application client does not respond, the application is disposed. |
Important
- XAF Blazor authenticates each request. The authentication state is not retained between requests and the request source cannot be identified.
- XAF Blazor UI supports Interactive Server render mode only.
See Also