C# Class Infrastructure.Data.EntityFramework.Lab.DbContextManager

Afficher le fichier Open project: huyrua/efprs

Méthodes publiques

Свойство Type Description
DefaultConnectionStringName string

Private Properties

Свойство Type Description
AddConfiguration void

Méthodes publiques

Méthode Description
CloseAllDbContexts ( ) : void

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

CurrentFor ( string key ) : DbContext

Used to get the current DbContext 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 ( IDbContextStorage storage ) : void

Private Methods

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

Method Details

CloseAllDbContexts() public static méthode

This method is used by application-specific db context storage implementations and unit tests. Its job is to walk thru existing cached object context(s) and Close() each one.
public static CloseAllDbContexts ( ) : void
Résultat void

CurrentFor() public static méthode

Used to get the current DbContext 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 ) : DbContext
key string
Résultat DbContext

Init() public static méthode

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

Init() public static méthode

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

InitStorage() public static méthode

public static InitStorage ( IDbContextStorage storage ) : void
storage IDbContextStorage
Résultat 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
Résultat string