C# Class Masonry.Core.Composition.MvcContainerConfiguration

A ContainerConfiguration that loads parts in the currently-executing ASP.NET MVC web application. Parts are detected by namespace - classes in a ".Parts" namespace will be considered to be parts. These classes, and any interfaces they implement, will be exported and shared on a per-HTTP-request basis. When resolving dependencies, the longest public constructor on a part type will be used. The ImportAttribute, ExportAttribute and associated MEF attributes can be applied to modify composition structure.
This implementation emulates CompositionContainer and the composition-container based MVC integration for all types under the Parts namespace, for controllers, and for model binders. This will aid migration from one composition engine to the other, but this decision should be revisited if it causes confusion.
Inheritance: ContainerConfiguration
Show file Open project: DenisVuyka/Masonry Class Usage Examples

Public Methods

Method Description
MvcContainerConfiguration ( ) : System

Construct an MvcContainerConfiguration using parts in the main application assembly. In some applications this may not be the expected assembly - in those cases specify the assemblies explicitly using the other constructor.

MvcContainerConfiguration ( IEnumerable assemblies ) : System

Construct an MvcContainerConfiguration using parts in the specified assemblies.

MvcContainerConfiguration ( IEnumerable assemblies, System.Composition.Convention.AttributedModelProvider reflectionContext ) : System

Private Methods

Method Description
DefineConventions ( ) : System.Composition.Convention.AttributedModelProvider
GuessGlobalApplicationAssembly ( ) : Assembly

Method Details

MvcContainerConfiguration() public method

Construct an MvcContainerConfiguration using parts in the main application assembly. In some applications this may not be the expected assembly - in those cases specify the assemblies explicitly using the other constructor.
public MvcContainerConfiguration ( ) : System
return System

MvcContainerConfiguration() public method

Construct an MvcContainerConfiguration using parts in the specified assemblies.
public MvcContainerConfiguration ( IEnumerable assemblies ) : System
assemblies IEnumerable Assemblies in which to search for parts.
return System

MvcContainerConfiguration() public method

public MvcContainerConfiguration ( IEnumerable assemblies, System.Composition.Convention.AttributedModelProvider reflectionContext ) : System
assemblies IEnumerable
reflectionContext System.Composition.Convention.AttributedModelProvider
return System