Skip to content

AppBuilder class

Defined in

Namespace: Splat.Builder Assembly: Splat.Builder.dll Full name: Splat.Builder.AppBuilder Modifiers: public

Summary

View source

        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

NameSummary
.ctorInitializes a new instance of the [AppBuilder](# class with the specified dependency resolver.

Properties

NameSummary
static HasBeenBuiltGets a value indicating whether this instance has been built.
static UsingBuilderGets a value indicating whether the application builder is being used.
CurrentGets the current dependency resolver in use by the application.
CurrentMutableGets the current mutable dependency resolver used for registering and resolving services at runtime.

Methods

NameSummary
static CreateSplatBuilderCreates a new instance of the application builder using the current mutable and immutable service locators.
static ResetBuilderStateForTestsResets the internal builder state to its initial values for use in unit tests.
UseCurrentSplatLocatorConfigures the application to use the current Splat service locator (AppLocator.CurrentMutable) for dependency resolution.
UsingModuleRegisters a module for application configuration using the specified module instance.
WithCustomRegistrationAdds a custom dependency registration action to the application builder.
WithCoreServicesAdds the core framework services to the application builder.
BuildFinalizes the configuration and builds the application instance, making it ready for use.

Derived types

Inherited members