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

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

    Parameters

    context
    An DbContext to set as default.
    contextType
    The type (derived from DbContext) 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 DbContext used in C1DataSource controls. Register a custom DbContext on startup before any C1DataSource instances are created.
    See Also