C# Класс Infrastructure.Data.EntityFramework.ObjectContextManager

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DefaultConnectionStringName string

Private Properties

Свойство Тип Описание
AddConfiguration void

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

Метод Описание
CloseAllObjectContexts ( ) : void

This method is used by application-specific object context storage implementations and unit tests. Its job is to walk thru existing cached object context(s) and Close() each one.

CurrentFor ( string key ) : ObjectContext

Used to get the current ObjectContext associated with a key; i.e., the key associated with an object context for a specific database. If you're only communicating with one database, you should call Current instead, although you're certainly welcome to call this if you have the key available.

Init ( string mappingAssemblies, bool recreateDatabaseIfExist = false, bool lazyLoadingEnabled = true ) : void
Init ( string connectionStringName, string mappingAssemblies, bool recreateDatabaseIfExist = false, bool lazyLoadingEnabled = true ) : void
InitStorage ( IObjectContextStorage storage ) : void

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

Метод Описание
AddConfiguration ( string connectionStringName, string mappingAssemblies, bool recreateDatabaseIfExists = false, bool lazyLoadingEnabled = true ) : void

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

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

This method is used by application-specific object context storage implementations and unit tests. Its job is to walk thru existing cached object context(s) and Close() each one.
public static CloseAllObjectContexts ( ) : void
Результат void

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

Used to get the current ObjectContext associated with a key; i.e., the key associated with an object context for a specific database. If you're only communicating with one database, you should call Current instead, although you're certainly welcome to call this if you have the key available.
public static CurrentFor ( string key ) : ObjectContext
key string
Результат ObjectContext

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

public static Init ( string mappingAssemblies, bool recreateDatabaseIfExist = false, bool lazyLoadingEnabled = true ) : void
mappingAssemblies string
recreateDatabaseIfExist bool
lazyLoadingEnabled bool
Результат void

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

public static Init ( string connectionStringName, string mappingAssemblies, bool recreateDatabaseIfExist = false, bool lazyLoadingEnabled = true ) : void
connectionStringName string
mappingAssemblies string
recreateDatabaseIfExist bool
lazyLoadingEnabled bool
Результат void

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

public static InitStorage ( IObjectContextStorage storage ) : void
storage IObjectContextStorage
Результат void

Описание свойств

DefaultConnectionStringName публичное статическое свойство

The default connection string name used if only one database is being communicated with.
public static string DefaultConnectionStringName
Результат string