Table of Contents

Class NullServiceType

Namespace
Splat
Assembly
Splat.Core.dll

Represents a service type that always returns null when resolved. Used as a placeholder or marker in dependency injection scenarios where a service is intentionally absent.

public class NullServiceType
Inheritance
NullServiceType
Extension Methods

Constructors

NullServiceType(Func<object?>)

Represents a service type that always returns null when resolved. Used as a placeholder or marker in dependency injection scenarios where a service is intentionally absent.

public NullServiceType(Func<object?> factory)

Parameters

factory Func<object>

A delegate that produces the service instance. The delegate should return null to indicate the absence of a service.

Fields

CachedType

Gets the cached Type instance representing the NullServiceType type.

public static readonly Type CachedType

Field Value

Type

Remarks

This field can be used to avoid repeated calls to GetType() or typeof for NullServiceType. It is intended for scenarios where a reference to the NullServiceType type is needed multiple times.

Properties

Factory

Gets the function used to create an instance of the associated object.

public Func<object?> Factory { get; }

Property Value

Func<object>