Skip to content

DovetailHostBuilderExtensions Methods

ClassMethods20 members
Base convention extensions
Set key to the value if the type is missing
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder AddIfMissing<T>(
this DovetailContextBuilder builder,
T value)
{
// ...
}
}
builderDovetailContextBuilderThe builder
valueTThe value to save
ArgumentNullExceptionbuilder is null.
AddIfMissing(DovetailContextBuilder, Type, object)Section titled AddIfMissing(DovetailContextBuilder, Type, object)extensionDovetailContextBuilder
Set key to the value if the key is missing
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder AddIfMissing(
this DovetailContextBuilder builder,
Type key,
object value)
{
// ...
}
}
builderDovetailContextBuilderThe builder
keyTypeThe key where the value is saved
valueobjectThe value to save
ArgumentNullExceptionbuilder is null.
AddIfMissing(DovetailContextBuilder, string, T)Section titled AddIfMissing(DovetailContextBuilder, string, T)extensionDovetailContextBuilder
Set key to the value if the key is missing
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder AddIfMissing<T>(
this DovetailContextBuilder builder,
string key,
T value)
{
// ...
}
}
builderDovetailContextBuilderThe builder
keystringThe key where the value is saved
valueTThe value to save
ArgumentNullExceptionbuilder is null.
Get(DovetailContextBuilder)Section titled Get(DovetailContextBuilder)extensionnullableT?
Get a value by type from the context
public static class DovetailHostBuilderExtensions
{
public static T? Get<T>(
this DovetailContextBuilder context)
{
// ...
}
}
contextDovetailContextBuilderThe context
T?T.
ArgumentNullExceptioncontext is null.
Get(DovetailContextBuilder, string)Section titled Get(DovetailContextBuilder, string)extensionnullableT?
Get a value by key from the context
public static class DovetailHostBuilderExtensions
{
public static T? Get<T>(
this DovetailContextBuilder context,
string key)
{
// ...
}
}
contextDovetailContextBuilderThe context
keystringThe key where the value is saved
T?T.
ArgumentNullExceptioncontext is null.
GetHostType(DovetailContextBuilder)Section titled GetHostType(DovetailContextBuilder)extensionDovetailHostType
Get the host type the builder is currently configured for
public static class DovetailHostBuilderExtensions
{
public static DovetailHostType GetHostType(
this DovetailContextBuilder context)
{
// ...
}
}
contextDovetailContextBuilderThe context
DovetailHostTypeThe DovetailHostType for the builder, or DovetailHostType.Undefined if none was registered.
GetOrAdd(DovetailContextBuilder, Func<T>)Section titled GetOrAdd(DovetailContextBuilder, Func<T>)extensionT
Get a value by key from the context
public static class DovetailHostBuilderExtensions
{
public static T GetOrAdd<T>(
this DovetailContextBuilder builder,
Func<T> factory)
{
// ...
}
}
builderDovetailContextBuilderThe builder
factoryFunc<T>The factory method in the event the type is not found
TT.
ArgumentNullExceptionbuilder or factory is null.
GetOrAdd(DovetailContextBuilder, string, Func<T>)Section titled GetOrAdd(DovetailContextBuilder, string, Func<T>)extensionT
Get a value by key from the context
public static class DovetailHostBuilderExtensions
{
public static T GetOrAdd<T>(
this DovetailContextBuilder builder,
string key,
Func<T> factory)
{
// ...
}
}
builderDovetailContextBuilderThe builder
keystringThe key where the value is saved
factoryFunc<T>The factory method in the event the type is not found
TT.
ArgumentNullExceptionbuilder or factory is null.
IsUnitTestHost(DovetailContextBuilder)Section titled IsUnitTestHost(DovetailContextBuilder)extensionbool
Check if this is a test host (to allow conventions to behave differently during unit tests)
public static class DovetailHostBuilderExtensions
{
public static bool IsUnitTestHost(
this DovetailContextBuilder context)
{
// ...
}
}
contextDovetailContextBuilderThe context
booltrue if context is running under DovetailHostType.UnitTest; otherwise, false.
ArgumentNullExceptioncontext is null.
Require(DovetailContextBuilder)Section titled Require(DovetailContextBuilder)extensionT
Get a value by type from the context or throw
public static class DovetailHostBuilderExtensions
{
public static T Require<T>(
this DovetailContextBuilder context)
{
// ...
}
}
contextDovetailContextBuilderThe context
TT.
ArgumentNullExceptioncontext is null.
KeyNotFoundExceptionNo value of type T was found in the context.
Require(DovetailContextBuilder, string)Section titled Require(DovetailContextBuilder, string)extensionT
Get a value by type from the context or throw
public static class DovetailHostBuilderExtensions
{
public static T Require<T>(
this DovetailContextBuilder context,
string key)
{
// ...
}
}
contextDovetailContextBuilderThe context
keystringThe key where the value is saved
TT.
ArgumentNullExceptioncontext is null.
KeyNotFoundExceptionNo value of type T was found at key.
Get a value by type from the context
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder Set<T>(
this DovetailContextBuilder context,
T value)
{
// ...
}
}
contextDovetailContextBuilderThe context
valueTThe value to save
ArgumentNullExceptioncontext is null.
Get a value by type from the context
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder Set(
this DovetailContextBuilder context,
Type key,
object value)
{
// ...
}
}
contextDovetailContextBuilderThe context
keyTypeThe key where the value is saved
valueobjectThe value to save
ArgumentNullExceptioncontext is null.
Get a value by type from the context
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder Set<T>(
this DovetailContextBuilder context,
string key,
T value)
{
// ...
}
}
contextDovetailContextBuilderThe context
keystringThe key where the value is saved
valueTThe value to save
ArgumentNullExceptioncontext is null.
UseServiceProviderFactory(DovetailContextBuilder, IServiceProviderFactory<TContainerBuilder>)Section titled UseServiceProviderFactory(DovetailContextBuilder, IServiceProviderFactory<TContainerBuilder>)extensionDovetailContextBuilder
Set the service provider factory to be used for hosting or other systems.
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder UseServiceProviderFactory<TContainerBuilder>(
this DovetailContextBuilder builder,
IServiceProviderFactory<TContainerBuilder> serviceProviderFactory)
{
// ...
}
}
builderDovetailContextBuilderThe context builder to configure.
serviceProviderFactoryIServiceProviderFactory<TContainerBuilder>The service provider factory to use.
DovetailContextBuilderThe builder, for chaining.
ArgumentNullExceptionbuilder is null.
UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)Section titled UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionDovetailContextBuilder
Set the service provider factory to be used for hosting or other systems.
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder UseServiceProviderFactory<TContainerBuilder>(
this DovetailContextBuilder builder,
Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>> serviceProviderFactory)
{
// ...
}
}
builderDovetailContextBuilderThe context builder to configure.
serviceProviderFactoryFunc<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>A factory method that asynchronously produces the service provider factory to use.
DovetailContextBuilderThe builder, for chaining.
ArgumentNullExceptionbuilder is null.
UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)Section titled UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionDovetailContextBuilder
Set the service provider factory to be used for hosting or other systems.
public static class DovetailHostBuilderExtensions
{
public static DovetailContextBuilder UseServiceProviderFactory<TContainerBuilder>(
this DovetailContextBuilder builder,
Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>> serviceProviderFactory)
{
// ...
}
}
builderDovetailContextBuilderThe context builder to configure.
serviceProviderFactoryFunc<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>A factory method that asynchronously produces the service provider factory to use.
DovetailContextBuilderThe builder, for chaining.
ArgumentNullExceptionbuilder is null.
UseServiceProviderFactory(IDovetailContext, IServiceProviderFactory<TContainerBuilder>)Section titled UseServiceProviderFactory(IDovetailContext, IServiceProviderFactory<TContainerBuilder>)extensionIDovetailContext
Set the service provider factory to be used for hosting or other systems.
public static class DovetailHostBuilderExtensions
{
public static IDovetailContext UseServiceProviderFactory<TContainerBuilder>(
this IDovetailContext builder,
IServiceProviderFactory<TContainerBuilder> serviceProviderFactory)
{
// ...
}
}
builderIDovetailContextThe context to configure.
serviceProviderFactoryIServiceProviderFactory<TContainerBuilder>The service provider factory to use.
IDovetailContextThe builder, for chaining.
ArgumentNullExceptionbuilder is null.
UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)Section titled UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionIDovetailContext
Set the service provider factory to be used for hosting or other systems.
public static class DovetailHostBuilderExtensions
{
public static IDovetailContext UseServiceProviderFactory<TContainerBuilder>(
this IDovetailContext builder,
Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>> serviceProviderFactory)
{
// ...
}
}
builderIDovetailContextThe context to configure.
serviceProviderFactoryFunc<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>A factory method that asynchronously produces the service provider factory to use.
IDovetailContextThe builder, for chaining.
ArgumentNullExceptionbuilder is null.
UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)Section titled UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionIDovetailContext
Set the service provider factory to be used for hosting or other systems.
public static class DovetailHostBuilderExtensions
{
public static IDovetailContext UseServiceProviderFactory<TContainerBuilder>(
this IDovetailContext builder,
Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>> serviceProviderFactory)
{
// ...
}
}
builderIDovetailContextThe context to configure.
serviceProviderFactoryFunc<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>A factory method that asynchronously produces the service provider factory to use.
IDovetailContextThe builder, for chaining.
ArgumentNullExceptionbuilder is null.