Show / Hide Table of Contents

Class CompositionContainerBuilderBase<TBuilder>

Base class for composition container builders.

Inheritance
System.Object
CompositionContainerBuilderBase<TBuilder>
AutofacCompositionContainerBuilder
LiteCompositionContainerBuilder
MefCompositionContainerBuilder
Implements
ICompositionContainerBuilder
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Composition.Hosting
Assembly: Kephas.Core.dll
Syntax
public abstract class CompositionContainerBuilderBase<TBuilder> : ICompositionContainerBuilder where TBuilder : CompositionContainerBuilderBase<TBuilder>
Type Parameters
Name Description
TBuilder

The type of the builder.

Constructors

| Improve this Doc View Source

CompositionContainerBuilderBase(ICompositionRegistrationContext)

Initializes a new instance of the CompositionContainerBuilderBase<TBuilder> class.

Declaration
protected CompositionContainerBuilderBase(ICompositionRegistrationContext context)
Parameters
Type Name Description
ICompositionRegistrationContext context

The context.

Properties

| Improve this Doc View Source

AppRuntime

Gets the application runtime.

Declaration
public IAppRuntime AppRuntime { get; }
Property Value
Type Description
IAppRuntime

The application runtime.

| Improve this Doc View Source

CompositionParts

Gets the composition parts.

Declaration
protected HashSet<Type> CompositionParts { get; }
Property Value
Type Description
System.Collections.Generic.HashSet<System.Type>

The composition parts.

| Improve this Doc View Source

ConventionsBuilder

Gets the conventions builder.

Declaration
protected IConventionsBuilder ConventionsBuilder { get; }
Property Value
Type Description
IConventionsBuilder

The conventions builder.

| Improve this Doc View Source

Logger

Gets the logger.

Declaration
protected ILogger Logger { get; }
Property Value
Type Description
ILogger

The logger.

| Improve this Doc View Source

LogManager

Gets the log manager.

Declaration
public ILogManager LogManager { get; }
Property Value
Type Description
ILogManager

The log manager.

| Improve this Doc View Source

Registry

Gets the IAppServiceInfo registry.

Declaration
protected CompositionContainerBuilderBase<TBuilder>.AppServiceInfoRegistry Registry { get; }
Property Value
Type Description
CompositionContainerBuilderBase.AppServiceInfoRegistry<>

The registry.

| Improve this Doc View Source

TypeLoader

Gets the type loader.

Declaration
public ITypeLoader TypeLoader { get; }
Property Value
Type Description
ITypeLoader

The type loader.

Methods

| Improve this Doc View Source

AssertRequiredService<TService>(TService)

Asserts the the required service is not missing.

Declaration
protected void AssertRequiredService<TService>(TService service)
Parameters
Type Name Description
TService service

The service.

Type Parameters
Name Description
TService

Type of the service.

Exceptions
Type Condition
System.InvalidOperationException

Thrown when the requested operation is invalid.

| Improve this Doc View Source

CreateContainer()

Creates the container with the provided configuration asynchronously.

Declaration
public virtual ICompositionContext CreateContainer()
Returns
Type Description
ICompositionContext

A new container with the provided configuration.

| Improve this Doc View Source

CreateContainerCore(IConventionsBuilder, IEnumerable<Type>)

Creates a new composition container based on the provided conventions and assembly parts.

Declaration
protected abstract ICompositionContext CreateContainerCore(IConventionsBuilder conventions, IEnumerable<Type> parts)
Parameters
Type Name Description
IConventionsBuilder conventions

The conventions.

System.Collections.Generic.IEnumerable<System.Type> parts

The parts candidating for composition.

Returns
Type Description
ICompositionContext

A new composition container.

| Improve this Doc View Source

CreateConventionsBuilder()

Factory method for creating the conventions builder.

Declaration
protected abstract IConventionsBuilder CreateConventionsBuilder()
Returns
Type Description
IConventionsBuilder

A newly created conventions builder.

| Improve this Doc View Source

GetCompositionAssemblies()

Gets the composition assemblies.

Declaration
protected IEnumerable<Assembly> GetCompositionAssemblies()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.Assembly>

An enumeration of assemblies used for composition.

| Improve this Doc View Source

GetConventionAssemblies(IEnumerable<Assembly>)

Gets the convention assemblies.

Declaration
protected IEnumerable<Assembly> GetConventionAssemblies(IEnumerable<Assembly> fallbackAssemblies)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> fallbackAssemblies

The fallback assemblies, used if no convention assemblies are provided.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.Assembly>

An enumeration of assemblies used for conventions.

| Improve this Doc View Source

GetConventions(IEnumerable<Assembly>, IList<Type>)

Gets the convention builder.

Declaration
protected virtual IConventionsBuilder GetConventions(IEnumerable<Assembly> assemblies, IList<Type> parts)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> assemblies

The assemblies containing the conventions.

System.Collections.Generic.IList<System.Type> parts

The parts.

Returns
Type Description
IConventionsBuilder

The convention builder.

| Improve this Doc View Source

GetSettings()

Gets the composition settings.

Declaration
protected virtual CompositionSettings GetSettings()
Returns
Type Description
CompositionSettings

The composition settings.

| Improve this Doc View Source

WithAssemblies(IEnumerable<Assembly>)

Adds the assemblies containing the composition parts.

Declaration
public virtual TBuilder WithAssemblies(IEnumerable<Assembly> assemblies)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> assemblies

The composition assemblies.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the provided assemblies are added to the existing ones.

| Improve this Doc View Source

WithAssembly(Assembly)

Adds the assembly containing the composition parts.

Declaration
public virtual TBuilder WithAssembly(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The composition assembly.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the provided assembly is added to the existing ones.

| Improve this Doc View Source

WithConventionAssemblies(IEnumerable<Assembly>)

Adds the assemblies containing the conventions.

Declaration
public virtual TBuilder WithConventionAssemblies(IEnumerable<Assembly> assemblies)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> assemblies

The convention assemblies.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the provided assemblies are added to the existing ones.

| Improve this Doc View Source

WithConventionAssembly(Assembly)

Adds the assembly containing the conventions.

Declaration
public virtual TBuilder WithConventionAssembly(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The convention assembly.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the provided assembly is added to the existing ones.

| Improve this Doc View Source

WithConventions(IConventionsBuilder)

Sets the composition conventions.

Declaration
public virtual TBuilder WithConventions(IConventionsBuilder conventions)
Parameters
Type Name Description
IConventionsBuilder conventions

The conventions.

Returns
Type Description
TBuilder

This builder.

| Improve this Doc View Source

WithConventionsRegistrar(IConventionsRegistrar)

Adds the export provider.

Declaration
public virtual TBuilder WithConventionsRegistrar(IConventionsRegistrar conventionsRegistrar)
Parameters
Type Name Description
IConventionsRegistrar conventionsRegistrar

The conventions registrar.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the factories are added to the existing ones.

| Improve this Doc View Source

WithFactory<TContract>(Func<TContract>, Boolean, Boolean)

Adds the factory export.

Declaration
public virtual TBuilder WithFactory<TContract>(Func<TContract> factory, bool isSingleton = false, bool allowMultiple = false)
Parameters
Type Name Description
System.Func<TContract> factory

The factory.

System.Boolean isSingleton

If set to true, the factory returns a shared component, otherwise an instance component.

System.Boolean allowMultiple

Indicates whether multiple registrations are allowed.

Returns
Type Description
TBuilder

This builder.

Type Parameters
Name Description
TContract

The type of the contract.

Remarks

Can be used multiple times, the factories are added to the existing ones.

| Improve this Doc View Source

WithPart(Type)

Adds the composition parts.

Declaration
public virtual TBuilder WithPart(Type part)
Parameters
Type Name Description
System.Type part

The composition part.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the provided part is added to the existing ones.

| Improve this Doc View Source

WithParts(IEnumerable<Type>)

Adds the composition parts.

Declaration
public virtual TBuilder WithParts(IEnumerable<Type> parts)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Type> parts

The parts.

Returns
Type Description
TBuilder

This builder.

Remarks

Can be used multiple times, the provided parts are added to the existing ones.

| Improve this Doc View Source

WithRegistration(IAppServiceInfo[])

Adds the registrations.

Declaration
public virtual TBuilder WithRegistration(params IAppServiceInfo[] registrations)
Parameters
Type Name Description
IAppServiceInfo[] registrations

A variable-length parameters list containing registrations.

Returns
Type Description
TBuilder

A TBuilder.

Implements

ICompositionContainerBuilder

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX