DovetailHostBuilderExtensions Methods
ClassMethods20 members
Base convention extensions
AddIfMissing(DovetailContextBuilder, T) Section titled AddIfMissing(DovetailContextBuilder, T)extensionDovetail Set key to the value if the type is missing
public static class DovetailHostBuilderExtensions{ public static DovetailContextBuilder AddIfMissing<T>( this DovetailContextBuilder builder, T value) { // ... }}Parameters
builderDovetailvalueTThe value to saveExceptions
ArgumentNullExceptionbuilder is null.AddIfMissing(DovetailContextBuilder, Type, object) Section titled AddIfMissing(DovetailContextBuilder, Type, object)extensionDovetail 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) { // ... }}Parameters
builderDovetailkeyTypeThe key where the value is savedvalueobjectThe value to saveExceptions
ArgumentNullExceptionbuilder is null.AddIfMissing(DovetailContextBuilder, string, T) Section titled AddIfMissing(DovetailContextBuilder, string, T)extensionDovetail 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) { // ... }}Parameters
builderDovetailkeystringThe key where the value is savedvalueTThe value to saveExceptions
ArgumentNullExceptionbuilder is null. Get a value by type from the context
public static class DovetailHostBuilderExtensions{ public static T? Get<T>( this DovetailContextBuilder context) { // ... }}Parameters
contextDovetailReturns
T?T.Exceptions
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) { // ... }}Parameters
contextDovetailkeystringThe key where the value is savedReturns
T?T.Exceptions
ArgumentNullExceptioncontext is null.GetHostType(DovetailContextBuilder) Section titled GetHostType(DovetailContextBuilder)extensionDovetail Get the host type the builder is currently configured for
public static class DovetailHostBuilderExtensions{ public static DovetailHostType GetHostType( this DovetailContextBuilder context) { // ... }}Parameters
contextDovetailReturns
DovetailHostType The 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) { // ... }}Parameters
builderDovetailfactoryFunc<T> The factory method in the event the type is not foundReturns
TT.Exceptions
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) { // ... }}Parameters
builderDovetailkeystringThe key where the value is savedfactoryFunc<T> The factory method in the event the type is not foundReturns
TT.Exceptions
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) { // ... }}Parameters
contextDovetailReturns
booltrue if context is running under DovetailHostType.UnitTest ; otherwise, false.Exceptions
ArgumentNullExceptioncontext is null. Get a value by type from the context or throw
public static class DovetailHostBuilderExtensions{ public static T Require<T>( this DovetailContextBuilder context) { // ... }}Parameters
contextDovetailReturns
TT.Exceptions
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) { // ... }}Parameters
contextDovetailkeystringThe key where the value is savedReturns
TT.Exceptions
ArgumentNullExceptioncontext is null.KeyNotFoundExceptionNo value of type T was found at key.Set(DovetailContextBuilder, T) Section titled Set(DovetailContextBuilder, T)extensionDovetail Get a value by type from the context
public static class DovetailHostBuilderExtensions{ public static DovetailContextBuilder Set<T>( this DovetailContextBuilder context, T value) { // ... }}Parameters
contextDovetailvalueTThe value to saveExceptions
ArgumentNullExceptioncontext is null.Set(DovetailContextBuilder, Type, object) Section titled Set(DovetailContextBuilder, Type, object)extensionDovetail Get a value by type from the context
public static class DovetailHostBuilderExtensions{ public static DovetailContextBuilder Set( this DovetailContextBuilder context, Type key, object value) { // ... }}Parameters
contextDovetailkeyTypeThe key where the value is savedvalueobjectThe value to saveExceptions
ArgumentNullExceptioncontext is null.Set(DovetailContextBuilder, string, T) Section titled Set(DovetailContextBuilder, string, T)extensionDovetail Get a value by type from the context
public static class DovetailHostBuilderExtensions{ public static DovetailContextBuilder Set<T>( this DovetailContextBuilder context, string key, T value) { // ... }}Parameters
contextDovetailkeystringThe key where the value is savedvalueTThe value to saveExceptions
ArgumentNullExceptioncontext is null.UseServiceProviderFactory(DovetailContextBuilder, IServiceProviderFactory<TContainerBuilder>) Section titled UseServiceProviderFactory(DovetailContextBuilder, IServiceProviderFactory<TContainerBuilder>)extensionDovetail 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) { // ... }}Parameters
builderDovetailserviceProviderFactory IServiceProviderFactory<TContainerBuilder> The service provider factory to use.Returns
DovetailContextBuilder The builder, for chaining.Exceptions
ArgumentNullExceptionbuilder is null.UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>) Section titled UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionDovetail 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) { // ... }}Parameters
builderDovetailserviceProviderFactory Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>> A factory method that asynchronously produces the service provider factory to use.Returns
DovetailContextBuilder The builder, for chaining.Exceptions
ArgumentNullExceptionbuilder is null.UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>) Section titled UseServiceProviderFactory(DovetailContextBuilder, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionDovetail 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) { // ... }}Parameters
builderDovetailserviceProviderFactory Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>> A factory method that asynchronously produces the service provider factory to use.Returns
DovetailContextBuilder The builder, for chaining.Exceptions
ArgumentNullExceptionbuilder is null.UseServiceProviderFactory(IDovetailContext, IServiceProviderFactory<TContainerBuilder>) Section titled UseServiceProviderFactory(IDovetailContext, IServiceProviderFactory<TContainerBuilder>)extensionI 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) { // ... }}Parameters
builderIserviceProviderFactory IServiceProviderFactory<TContainerBuilder> The service provider factory to use.Returns
IDovetailContext The builder, for chaining.Exceptions
ArgumentNullExceptionbuilder is null.UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>) Section titled UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionI 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) { // ... }}Parameters
builderIserviceProviderFactory Func<IDovetailContext, IServiceCollection, CancellationToken, ValueTask<IServiceProviderFactory<TContainerBuilder>>> A factory method that asynchronously produces the service provider factory to use.Returns
IDovetailContext The builder, for chaining.Exceptions
ArgumentNullExceptionbuilder is null.UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>) Section titled UseServiceProviderFactory(IDovetailContext, Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>>)extensionI 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) { // ... }}Parameters
builderIserviceProviderFactory Func<IDovetailContext, IServiceCollection, ValueTask<IServiceProviderFactory<TContainerBuilder>>> A factory method that asynchronously produces the service provider factory to use.Returns
IDovetailContext The builder, for chaining.Exceptions
ArgumentNullExceptionbuilder is null.