C# Class Infrastructure.Data.EntityFramework.ObjectContextManager

Exibir arquivo Open project: huyrua/efprs Class Usage Examples

Public Properties

Property Type Description
DefaultConnectionStringName string

Private Properties

Property Type Description
AddConfiguration void

Public Methods

Method Description
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

Private Methods

Method Description
AddConfiguration ( string connectionStringName, string mappingAssemblies, bool recreateDatabaseIfExists = false, bool lazyLoadingEnabled = true ) : void

Method Details

CloseAllObjectContexts() public static method

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
return void

CurrentFor() public static method

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
return ObjectContext

Init() public static method

public static Init ( string mappingAssemblies, bool recreateDatabaseIfExist = false, bool lazyLoadingEnabled = true ) : void
mappingAssemblies string
recreateDatabaseIfExist bool
lazyLoadingEnabled bool
return void

Init() public static method

public static Init ( string connectionStringName, string mappingAssemblies, bool recreateDatabaseIfExist = false, bool lazyLoadingEnabled = true ) : void
connectionStringName string
mappingAssemblies string
recreateDatabaseIfExist bool
lazyLoadingEnabled bool
return void

InitStorage() public static method

public static InitStorage ( IObjectContextStorage storage ) : void
storage IObjectContextStorage
return void

Property Details

DefaultConnectionStringName public_oe static_oe property

The default connection string name used if only one database is being communicated with.
public static string DefaultConnectionStringName
return string