Interface IEntityContextFactory
Handles creation of EntityContexts and DataUpdaters.
Namespace: LemonEdge.Connections.Database.Context
Assembly: LemonEdge.Database.Connector.dll
Syntax
public interface IEntityContextFactory
Properties
DatabaseCacheFactory
Declaration
IDatabaseCacheFactory DatabaseCacheFactory { get; set; }
Property Value
Type | Description |
---|---|
IDatabaseCacheFactory |
Methods
CheckForEntityDescriptorUpdates(IDataAccessor)
Runs through entities and checks for updated descriptors. If there are changes, the system rebuilds and compiles.
Declaration
Task CheckForEntityDescriptorUpdates(IDataAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
Returns
Type | Description |
---|---|
Task | A Task to await. |
Create(IDataAccessor)
Creates an EntityContext,
Declaration
Task<EntityContext> Create(IDataAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
Returns
Type | Description |
---|---|
Task<EntityContext> | A new EntityContext |
CreateUpdater(IDataAccessor, UserInfo, int?)
Creates a DataUpdater, and UserInfo, but with a specified timeout.
Declaration
Task<DataUpdater> CreateUpdater(IDataAccessor accessor, UserInfo user, int? commandTimeoutInSeconds = null)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
UserInfo | user | An instance of UserInfo |
int? | commandTimeoutInSeconds | An optional timeout. |
Returns
Type | Description |
---|---|
Task<DataUpdater> | A new DataUpdater |
CreateUpdaterWithoutUpgradeCheck(IDataAccessor, UserInfo)
Creates a DataUpdater, and UserInfo. DOES NOT call EnsureDatabasesUpgraded(IDataAccessor, string).
Declaration
DataUpdater CreateUpdaterWithoutUpgradeCheck(IDataAccessor accessor, UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
UserInfo | user | An instance of UserInfo |
Returns
Type | Description |
---|---|
DataUpdater | A new DataUpdater |
CreateUpgrader(IDataAccessor)
Creates a DatabaseUpgrader, NOTE: Creates a NEW Accessor - so be wary if you're already upgrading.
Declaration
DatabaseUpgrader CreateUpgrader(IDataAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
Returns
Type | Description |
---|---|
DatabaseUpgrader | A new DatabaseUpgrader |
EnsureDatabasesUpgraded(IDataAccessor, string)
Validates that the DB is upgraded, upgrading if not.
Declaration
Task EnsureDatabasesUpgraded(IDataAccessor accessor, string source)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
string | source |
Returns
Type | Description |
---|---|
Task | A Task to await. |
IsUpgraded(IDataAccessor)
Returns true if the Database has already been upgraded.
Declaration
bool IsUpgraded(IDataAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
Returns
Type | Description |
---|---|
bool | True if upgraded, false if not. |
RegisterEntityDescriptorUpdaters()
Adds listeners to the DomainContextEventHandler to register AddIn changes...
Declaration
void RegisterEntityDescriptorUpdaters()
RunDbUpgrade(IDataAccessor, string)
Runs a Database upgrade. Use in conjunction with IsUpgraded(IDataAccessor).
Declaration
Task RunDbUpgrade(IDataAccessor accessor, string source)
Parameters
Type | Name | Description |
---|---|---|
IDataAccessor | accessor | An instance of IDataAccessor |
string | source |
Returns
Type | Description |
---|---|
Task | A Task to await. |