C# Класс 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.
Наследование: IModelContextProvider
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
GetStorage ( ) : Storage

Gets thread static or HttpContext storage for the ModelContext.

Описание методов

AddToPool() публичный статический Метод

Adds the specified ModelContext to the context pool.
public static AddToPool ( ModelContext context ) : void
context ModelContext The to add.
Результат void

EnsureContexts() публичный Метод

Specifies the minimum number of contexts that should be available in the pool or in use.
public EnsureContexts ( int minimumNumber ) : void
minimumNumber int
Результат void

FlushPool() публичный статический Метод

Removes all ModelContext instances from the pool.
public static FlushPool ( ) : void
Результат void

ModelContextProvider() публичный Метод

Creates a new ModelContextProvider and automatically assigns the instance as the current ModelContext.Provider implementation.
public ModelContextProvider ( ) : System
Результат System

OnCreateContext() защищенный Метод

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
Результат void