KlusterKite
0.0.0
A framework to create scalable and redundant services based on awesome Akka.Net project.
|
Base factory to create entity framework contexts More...
Public Member Functions | |
TContext | CreateContext< TContext > (string connectionString, string databaseName=null) |
Creates context attached to data source. Data source will be used as is. More... | |
Static Public Member Functions | |
static TContext | CreateContext< TContext > (DbContextOptions< TContext > options) |
Creates a new instance of context class More... | |
Protected Member Functions | |
abstract DbContextOptions< TContext > | GetContextOptions< TContext > (string connectionString, string databaseName) |
Creates a context options for a given data More... | |
Properties | |
abstract string | ProviderName [get] |
Gets a unique provider name More... | |
Properties inherited from KlusterKite.Data.EF.IContextFactory | |
string | ProviderName [get] |
Gets a unique provider name More... | |
Base factory to create entity framework contexts
Expected that TContext has a public constructor with DbContextOptions<TContext> argument
Definition at line 27 of file BaseContextFactory.cs.
|
static |
Creates a new instance of context class
TContext | The type of context |
options | The context options. |
InvalidOperationException | The context class must have a public constructor that accepts DbContextOptions<TContext> as single parameter |
TContext | : | DbContext |
Definition at line 48 of file BaseContextFactory.cs.
TContext KlusterKite.Data.EF.BaseContextFactory.CreateContext< TContext > | ( | string | connectionString, |
string | databaseName = null |
||
) |
Creates context attached to data source. Data source will be used as is.
Implements KlusterKite.Data.EF.IContextFactory.
TContext | : | DbContext |
Definition at line 55 of file BaseContextFactory.cs.
|
protectedpure virtual |
Creates a context options for a given data
TContext | The type of context |
connectionString | The connection string |
databaseName | The database name |
Implemented in KlusterKite.Data.EF.Npgsql.PostgresContextFactory, and KlusterKite.Data.EF.InMemory.InMemoryContextFactory.
TContext | : | DbContext |
|
get |
Gets a unique provider name
Definition at line 32 of file BaseContextFactory.cs.