Interface IDataContextFactory
Factory service for data contexts.
Namespace: Kephas.Data
Assembly: Kephas.Data.dll
Syntax
[SingletonAppServiceContract]
public interface IDataContextFactory
Remarks
Data contexts are dependent on initialization data, which typically contains at least data store connection information. Due to the fact that multiple physical data stores may be served by the same data context implementation and that by design, at one time, a data context instance may be connected to a single physical data store, there must be a factory service that creates a data context for a given connection. This is the data context factory application service.
Methods
| Improve this Doc View SourceCreateDataContext(String, IContext)
Creates a data context for the provided data store name and initializes it.
Declaration
IDataContext CreateDataContext(string dataStoreName, IContext initializationContext = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | dataStoreName | Name of the data store. This identifies typically an entry in the configuration where connection information and other initialization data is provided. |
IContext | initializationContext | An initialization context (optional). |
Returns
Type | Description |
---|---|
IDataContext | The newly created data context. |