Show / Hide Table of Contents

Class AutofacCompositionContextBase

An Autofac composition context base.

Inheritance
System.Object
AutofacCompositionContextBase
AutofacCompositionContainer
Implements
ICompositionContext
System.IDisposable
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.Autofac.Hosting
Assembly: Kephas.Composition.Autofac.dll
Syntax
public abstract class AutofacCompositionContextBase : ICompositionContext, IDisposable

Methods

| Improve this Doc View Source

AssertNotDisposed()

Asserts that the container is not disposed.

Declaration
protected void AssertNotDisposed()
| Improve this Doc View Source

CreateScopedContext()

Creates a new scoped composition context.

Declaration
public ICompositionContext CreateScopedContext()
Returns
Type Description
ICompositionContext

The new scoped context.

| Improve this Doc View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

Dispose(Boolean)

Releases unmanaged and - optionally - managed resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

| Improve this Doc View Source

GetExport(Type, String)

Resolves the specified contract type.

Declaration
public object GetExport(Type contractType, string serviceName = null)
Parameters
Type Name Description
System.Type contractType

Type of the contract.

System.String serviceName

The service name.

Returns
Type Description
System.Object

An object implementing contractType.

| Improve this Doc View Source

GetExport<T>(String)

Resolves the specified contract type.

Declaration
public T GetExport<T>(string serviceName = null)
Parameters
Type Name Description
System.String serviceName

The service name.

Returns
Type Description
T

An object implementing T.

Type Parameters
Name Description
T

The service type.

| Improve this Doc View Source

GetExports(Type)

Resolves the specified contract type returning multiple instances.

Declaration
public IEnumerable<object> GetExports(Type contractType)
Parameters
Type Name Description
System.Type contractType

Type of the contract.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Object>

An enumeration of objects implementing contractType.

| Improve this Doc View Source

GetExports<T>()

Resolves the specified contract type returning multiple instances.

Declaration
public IEnumerable<T> GetExports<T>()
Returns
Type Description
System.Collections.Generic.IEnumerable<T>

An enumeration of objects implementing T.

Type Parameters
Name Description
T

The service type.

| Improve this Doc View Source

Initialize(ILifetimeScope)

Initializes a new instance of the AutofacCompositionContextBase class.

Declaration
protected void Initialize(ILifetimeScope container)
Parameters
Type Name Description
Autofac.ILifetimeScope container

The inner container.

| Improve this Doc View Source

TryGetExport(Type, String)

Tries to resolve the specified contract type.

Declaration
public object TryGetExport(Type contractType, string serviceName = null)
Parameters
Type Name Description
System.Type contractType

Type of the contract.

System.String serviceName

The service name.

Returns
Type Description
System.Object

An object implementing contractType, or null if a service with the provided contract was not found.

| Improve this Doc View Source

TryGetExport<T>(String)

Tries to resolve the specified contract type.

Declaration
public T TryGetExport<T>(string serviceName = null)
Parameters
Type Name Description
System.String serviceName

The service name.

Returns
Type Description
T

An object implementing T, or null if a service with the provided contract was not found.

Type Parameters
Name Description
T

The service type.

Implements

ICompositionContext
System.IDisposable

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