Interface IAppBuilder
Defines a builder interface for configuring and constructing application instances with customizable modules, services, and dependency registrations.
public interface IAppBuilder
- Extension Methods
Remarks
The IAppBuilder interface enables fluent configuration of application components and services before creating an application instance. Implementations typically support method chaining, allowing multiple configuration steps to be composed in a single statement. This interface is intended for use in application startup code to register modules, configure dependency resolution, and set up core or custom services prior to building the final application instance.
Methods
Build()
Builds and returns a configured application instance.
IAppInstance Build()
Returns
- IAppInstance
An IAppInstance representing the configured application. The returned instance is ready for use according to the builder's configuration.
UseCurrentSplatLocator()
Configures the application to use the current Splat service locator for dependency resolution within the OWIN pipeline.
IAppBuilder UseCurrentSplatLocator()
Returns
- IAppBuilder
The IAppBuilder instance, enabling further configuration of the OWIN pipeline.
Remarks
Call this method to ensure that components relying on Splat's service locator can resolve dependencies during OWIN middleware execution. This is typically used when integrating Splat-based services into an OWIN application.
UsingModule<T>(T)
Registers the specified module with the application builder, enabling its services and configuration within the application pipeline.
IAppBuilder UsingModule<T>(T registrationModule) where T : IModule
Parameters
registrationModuleTThe module instance to register with the application builder. Cannot be null.
Returns
- IAppBuilder
The current IAppBuilder instance, enabling method chaining.
Type Parameters
TThe type of the module to register. Must implement the IModule interface.
WithCoreServices()
Adds the core framework services to the application builder.
IAppBuilder WithCoreServices()
Returns
- IAppBuilder
The current IAppBuilder instance with core services registered. This enables further configuration of the application pipeline.
WithCustomRegistration(Action<IMutableDependencyResolver>)
Configures the dependency resolver with custom registrations using the specified action.
IAppBuilder WithCustomRegistration(Action<IMutableDependencyResolver> configureAction)
Parameters
configureActionAction<IMutableDependencyResolver>An action that receives the mutable dependency resolver to which custom registrations can be added. Cannot be null.
Returns
- IAppBuilder
The current IAppBuilder instance, enabling method chaining.
Remarks
Use this method to add or override service registrations in the application's dependency resolver before the application is built. This is typically used to register custom services or replace default implementations.