Show / Hide Table of Contents

Class ServiceProviderFactory.Builder

Represents builder of the service provider.

Inheritance
object
ServiceProviderFactory.Builder
Implements
ISupplier<IServiceProvider>
IFunctional<Func<IServiceProvider>>
IResettable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public sealed class ServiceProviderFactory.Builder : ISupplier<IServiceProvider>, IFunctional<Func<IServiceProvider>>, IResettable

Methods

| Edit this page View Source

Add<TService>(TService)

Registers service of the specified type.

Declaration
public ServiceProviderFactory.Builder Add<TService>(TService service) where TService : notnull
Parameters
Type Name Description
TService service

The service instance.

Returns
Type Description
ServiceProviderFactory.Builder

This builder for subsequent calls.

Type Parameters
Name Description
TService

The type of the service.

Remarks

This builder doesn't allow registration of multiple services of the same type.

| Edit this page View Source

Build(IServiceProvider?)

Constructs service provider.

Declaration
public IServiceProvider Build(IServiceProvider? fallback = null)
Parameters
Type Name Description
IServiceProvider fallback

The fallback provider used for service resolution.

Returns
Type Description
IServiceProvider

The constructed service provider.

| Edit this page View Source

Reset()

Clears internal state of this builder and makes it reusable for subsequent calls.

Declaration
public void Reset()

Implements

ISupplier<TResult>
IFunctional<TDelegate>
IResettable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾