ComponentOne Data Source for Entity Framework
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 System.Data.Entity.DbContext, _
       ByVal contextType As System.Type _
    ) As System.IDisposable
    public static System.IDisposable RegisterContext( 
       System.Data.Entity.DbContext context,
       System.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