IConventionContext Interface

Summary

The base context marker interface to define this as a context
graph BT Type["IConventionContext"] class Type type-node Implementing0["MetricsBuilder"]-.->Type click Implementing0 "/api/Rocket.Surgery.Extensions.Metrics/MetricsBuilder" Implementing1["ServicesBuilder"]-.->Type click Implementing1 "/api/Rocket.Surgery.Extensions.DependencyInjection/ServicesBuilder" Implementing2["IHostingConventionContext"]-.->Type click Implementing2 "/api/Rocket.Surgery.Hosting/IHostingConventionContext" Implementing3["IServiceConventionContext"]-.->Type click Implementing3 "/api/Rocket.Surgery.Extensions.DependencyInjection/IServiceConventionContext" Implementing4["IAutofacConventionContext"]-.->Type click Implementing4 "/api/Rocket.Surgery.Extensions.Autofac/IAutofacConventionContext" Implementing5["IWebJobsConventionContext"]-.->Type click Implementing5 "/api/Rocket.Surgery.Extensions.WebJobs/IWebJobsConventionContext" Implementing6["ILoggingConventionContext"]-.->Type click Implementing6 "/api/Rocket.Surgery.Extensions.Logging/ILoggingConventionContext" Implementing7["ConventionContext"]-.->Type click Implementing7 "/api/Rocket.Surgery.Conventions/ConventionContext" Implementing8["AppMetricsBuilder"]-.->Type click Implementing8 "/api/Rocket.Surgery.Extensions.App.Metrics/AppMetricsBuilder" Implementing9["CommandLineBuilder"]-.->Type click Implementing9 "/api/Rocket.Surgery.Extensions.CommandLine/CommandLineBuilder" Implementing10["SerilogBuilder"]-.->Type click Implementing10 "/api/Rocket.Surgery.Extensions.Serilog/SerilogBuilder" Implementing11["ICommandLineConventionContext"]-.->Type click Implementing11 "/api/Rocket.Surgery.Extensions.CommandLine/ICommandLineConventionContext" Implementing12["WebJobsConventionBuilder"]-.->Type click Implementing12 "/api/Rocket.Surgery.Extensions.WebJobs/WebJobsConventionBuilder" Implementing13["ISerilogConventionContext"]-.->Type click Implementing13 "/api/Rocket.Surgery.Extensions.Serilog/ISerilogConventionContext" Implementing14["IServicesBuilder"]-.->Type click Implementing14 "/api/Rocket.Surgery.Extensions.DependencyInjection/IServicesBuilder" Implementing15["IAppMetricsConventionContext"]-.->Type click Implementing15 "/api/Rocket.Surgery.Extensions.App.Metrics/IAppMetricsConventionContext" Implementing16["AutofacBuilder"]-.->Type click Implementing16 "/api/Rocket.Surgery.Extensions.Autofac/AutofacBuilder" Implementing17["IConfigurationConventionContext"]-.->Type click Implementing17 "/api/Rocket.Surgery.Extensions.Configuration/IConfigurationConventionContext" Implementing18["IWebJobsConventionBuilder"]-.->Type click Implementing18 "/api/Rocket.Surgery.Extensions.WebJobs/IWebJobsConventionBuilder"

Syntax

public interface IConventionContext

Attributes

Type Description
NullableContextAttribute
DefaultMemberAttribute

Properties

Name Value Summary
Logger ILogger
Properties IDictionary<object, object>
A central location for sharing state between components during the convention building process.
this[object] object
Allows a context to hold additional information for conventions to consume such as configuration objects

Extension Methods

Name Value Summary
Get<T>(string) T
Get a value by key from the context
Get<T>() T
Get a value by type from the context
GetOrAdd<T>(Func<T>) T
Get a value by key from the context
GetOrAdd<T>(string, Func<T>) T
Get a value by key from the context
IsUnitTestHost() bool
Check if this is a test host (to allow conventions to behave differently during unit tests)
Set<T>(string, T) void
Get a value by type from the context
Set<T>(T) void
Get a value by type from the context
SetBackingValue<IConventionContext, TV>(Expression<Func<IConventionContext, TV>>, TV) T
Sets the backing value.
With<IConventionContext, TKey, TField>(Dictionary<TKey, TField>, IDictionary<TKey, TField>) TBuilder
Adds the specified dictionary to the provided dictionary.