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

Inheritance: IDbContextStorage
ファイルを表示 Open project: huyrua/efprs Class Usage Examples

Public Methods

Method Description
GetAllDbContexts ( ) : IEnumerable

Returns all the values of the internal dictionary of db contexts.

GetDbContextForKey ( string key ) : DbContext

Returns the db context associated with the specified key or null if the specified key is not found.

SetDbContextForKey ( string key, DbContext context ) : void

Stores the db context into a dictionary using the specified key. If an object context already exists by the specified key, it gets overwritten by the new object context passed in.

SimpleDbContextStorage ( ) : System

Initializes a new instance of the SimpleDbContextStorage class.

Method Details

GetAllDbContexts() public method

Returns all the values of the internal dictionary of db contexts.
public GetAllDbContexts ( ) : IEnumerable
return IEnumerable

GetDbContextForKey() public method

Returns the db context associated with the specified key or null if the specified key is not found.
public GetDbContextForKey ( string key ) : DbContext
key string The key.
return DbContext

SetDbContextForKey() public method

Stores the db context into a dictionary using the specified key. If an object context already exists by the specified key, it gets overwritten by the new object context passed in.
public SetDbContextForKey ( string key, DbContext context ) : void
key string The key.
context DbContext
return void

SimpleDbContextStorage() public method

Initializes a new instance of the SimpleDbContextStorage class.
public SimpleDbContextStorage ( ) : System
return System