C# Class ExoModel.ModelContextProvider

Implementation of IModelContextProvider that initializes a thread or web-request scoped ModelContext subclass, and allows subclasses to perform additional initialization work when new contexts are created.
Inheritance: IModelContextProvider
Datei anzeigen Open project: vc3/ExoModel Class Usage Examples

Public Methods

Method Description
AddToPool ( ModelContext context ) : void

Adds the specified ModelContext to the context pool.

EnsureContexts ( int minimumNumber ) : void

Specifies the minimum number of contexts that should be available in the pool or in use.

FlushPool ( ) : void

Removes all ModelContext instances from the pool.

ModelContextProvider ( ) : System

Creates a new ModelContextProvider and automatically assigns the instance as the current ModelContext.Provider implementation.

Protected Methods

Method Description
OnCreateContext ( ) : void

Base implementation that creates a new ModelContext instance.

Subclasses may override CreateContext to perform additional context initialization or even implement a context pool to select existing contexts that are not currently in use.

Private Methods

Method Description
GetStorage ( ) : Storage

Gets thread static or HttpContext storage for the ModelContext.

Method Details

AddToPool() public static method

Adds the specified ModelContext to the context pool.
public static AddToPool ( ModelContext context ) : void
context ModelContext The to add.
return void

EnsureContexts() public method

Specifies the minimum number of contexts that should be available in the pool or in use.
public EnsureContexts ( int minimumNumber ) : void
minimumNumber int
return void

FlushPool() public static method

Removes all ModelContext instances from the pool.
public static FlushPool ( ) : void
return void

ModelContextProvider() public method

Creates a new ModelContextProvider and automatically assigns the instance as the current ModelContext.Provider implementation.
public ModelContextProvider ( ) : System
return System

OnCreateContext() protected method

Base implementation that creates a new ModelContext instance.
Subclasses may override CreateContext to perform additional context initialization or even implement a context pool to select existing contexts that are not currently in use.
protected OnCreateContext ( ) : void
return void