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
Afficher le fichier Open project: vc3/ExoModel Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode Description
GetStorage ( ) : Storage

Gets thread static or HttpContext storage for the ModelContext.

Method Details

AddToPool() public static méthode

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

EnsureContexts() public méthode

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

FlushPool() public static méthode

Removes all ModelContext instances from the pool.
public static FlushPool ( ) : void
Résultat void

ModelContextProvider() public méthode

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

OnCreateContext() protected méthode

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
Résultat void