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["ILoggingConventionContext"]-.->Type click Implementing1 "/api/Rocket.Surgery.Extensions.Logging/ILoggingConventionContext" Implementing2["IAutofacConventionContext"]-.->Type click Implementing2 "/api/Rocket.Surgery.Extensions.Autofac/IAutofacConventionContext" Implementing3["AppMetricsBuilder"]-.->Type click Implementing3 "/api/Rocket.Surgery.Extensions.App.Metrics/AppMetricsBuilder" Implementing4["SerilogBuilder"]-.->Type click Implementing4 "/api/Rocket.Surgery.Extensions.Serilog/SerilogBuilder" Implementing5["ConventionContext"]-.->Type click Implementing5 "/api/Rocket.Surgery.Conventions/ConventionContext" Implementing6["IWebJobsConventionBuilder"]-.->Type click Implementing6 "/api/Rocket.Surgery.Extensions.WebJobs/IWebJobsConventionBuilder" Implementing7["IWebJobsConventionContext"]-.->Type click Implementing7 "/api/Rocket.Surgery.Extensions.WebJobs/IWebJobsConventionContext" Implementing8["ICommandLineConventionContext"]-.->Type click Implementing8 "/api/Rocket.Surgery.Extensions.CommandLine/ICommandLineConventionContext" Implementing9["IServicesBuilder"]-.->Type click Implementing9 "/api/Rocket.Surgery.Extensions.DependencyInjection/IServicesBuilder" Implementing10["ServicesBuilder"]-.->Type click Implementing10 "/api/Rocket.Surgery.Extensions.DependencyInjection/ServicesBuilder" Implementing11["CommandLineBuilder"]-.->Type click Implementing11 "/api/Rocket.Surgery.Extensions.CommandLine/CommandLineBuilder" Implementing12["IHostingConventionContext"]-.->Type click Implementing12 "/api/Rocket.Surgery.Hosting/IHostingConventionContext" Implementing13["WebJobsConventionBuilder"]-.->Type click Implementing13 "/api/Rocket.Surgery.Extensions.WebJobs/WebJobsConventionBuilder" Implementing14["IConfigurationConventionContext"]-.->Type click Implementing14 "/api/Rocket.Surgery.Extensions.Configuration/IConfigurationConventionContext" Implementing15["ISerilogConventionContext"]-.->Type click Implementing15 "/api/Rocket.Surgery.Extensions.Serilog/ISerilogConventionContext" Implementing16["IAppMetricsConventionContext"]-.->Type click Implementing16 "/api/Rocket.Surgery.Extensions.App.Metrics/IAppMetricsConventionContext" Implementing17["IServiceConventionContext"]-.->Type click Implementing17 "/api/Rocket.Surgery.Extensions.DependencyInjection/IServiceConventionContext" Implementing18["AutofacBuilder"]-.->Type click Implementing18 "/api/Rocket.Surgery.Extensions.Autofac/AutofacBuilder"

Syntax

public interface IConventionContext

Attributes

Type Description
NullableContextAttribute
DefaultMemberAttribute

Properties

Name Value Summary
Logger ILogger
A logger that is configured to work with each convention item
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.