AppBuilder class¶
Defined in
Namespace: Splat.Builder
Assembly: Splat.Builder.dll
Full name: Splat.Builder.AppBuilder
Modifiers: public
Summary¶
Provides a builder for configuring and constructing application dependency resolution and service registration using
Splat patterns.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Class hierarchy
classDiagram
class AppBuilder
class IAppBuilder {
<>
}
IAppBuilder <|.. AppBuilder
class IAppInstance {
<>
}
IAppInstance <|.. AppBuilder
Implements: IAppBuilder, IAppInstance
Remarks¶
The AppBuilder class enables fluent configuration of dependency resolvers, service modules, and custom registrations for applications using Splat. It supports chaining of registration methods and ensures that core services are registered before building the application instance. AppBuilder is typically used during application startup to configure dependency injection and service location. Thread safety is not guaranteed; configuration should be completed before the application is accessed from multiple threads.
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [AppBuilder](# class with the specified dependency resolver. |
Properties¶
| Name | Summary |
|---|---|
| static HasBeenBuilt | Gets a value indicating whether this instance has been built. |
| static UsingBuilder | Gets a value indicating whether the application builder is being used. |
| Current | Gets the current dependency resolver in use by the application. |
| CurrentMutable | Gets the current mutable dependency resolver used for registering and resolving services at runtime. |
Methods¶
| Name | Summary |
|---|---|
| static CreateSplatBuilder | Creates a new instance of the application builder using the current mutable and immutable service locators. |
| static ResetBuilderStateForTests | Resets the internal builder state to its initial values for use in unit tests. |
| UseCurrentSplatLocator | Configures the application to use the current Splat service locator (AppLocator.CurrentMutable) for dependency resolution. |
| UsingModule | Registers a module for application configuration using the specified module instance. |
| WithCustomRegistration | Adds a custom dependency registration action to the application builder. |
| WithCoreServices | Adds the core framework services to the application builder. |
| Build | Finalizes the configuration and builds the application instance, making it ready for use. |