DevForce Help Reference
CompositionContext Class
Members 


Determines a context for MEF discovery and composition.
Syntax
'Declaration
 
Public Class CompositionContext 
'Usage
 
Dim instance As CompositionContext
public class CompositionContext 
Remarks
The CompositionContext is used to set the context in which MEF composition occurs. MEF (the Managed Extensibility Framework from Microsoft) is used by DevForce to provide runtime extensibility. DevForce uses MEF to look for and instantiate custom implementations of the IIdGenerator, IVerifierProvider, EntityServerQueryInterceptor and all other DevForce interfaces and base classes intended for customization. Using a custom composition context you can control this behavior.

By default the Default context is used, which means that no special type or metadata filtering is performed. DevForce also provides a Fake context which is useful during testing to provide standardized fake implementations for 1) Id generation with the FakeIdGenerator; 2) an in-memory database with the EntityServerFakeBackingStore; 3) query functionality with the EdmQueryExecutorFake; and 4) save functionality with the EdmSaveExecutorFake.

You determine the composition context in use when you construct an EntityManager by optionally passing the name of the context wanted. When using any context other than the Default and Fake contexts provided, you can implement a custom ICompositionContextResolver to register and return the CompositionContext instance wanted. If you do not implement a custom resolver your custom contexts can also be registered automatically by the BaseCompositionContextResolver. When using a custom context you can determine the types to be exported for MEF composition, and include custom metadata filtering.

Inheritance Hierarchy

System.Object
   IdeaBlade.Core.Composition.CompositionContext

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CompositionContext Members
IdeaBlade.Core.Composition Namespace

Send Feedback