DataSource for Entity Framework in WPF
C1.Data.Entities Namespace / EntityClientCache Class / RegisterContext Method / RegisterContext(ObjectContext,Type) Method
An ObjectContext to set as default.
The type (derived from ObjectContext) to register the context for.

In This Topic
    RegisterContext(ObjectContext,Type) Method
    In This Topic
    Registers an ObjectContext as a default for C1DataSource controls for a given contextType.
    Syntax
    'Declaration
     
    Public Overloads Shared Function RegisterContext( _
       ByVal context As ObjectContext, _
       ByVal contextType As Type _
    ) As IDisposable
    public static IDisposable RegisterContext( 
       ObjectContext context,
       Type contextType
    )

    Parameters

    context
    An ObjectContext to set as default.
    contextType
    The type (derived from ObjectContext) to register the context for.

    Return Value

    An System.IDisposable to unregister the context.
    Exceptions
    ExceptionDescription
    Another context is already registered for the given contextType.
    Remarks
    Use this method when you need to customize the default ObjectContext used in C1DataSource controls. Register a custom ObjectContext on startup before any C1DataSource instances are created.
    See Also