Class CustomUpgradeHelper
Inherited Members
Namespace: LemonEdge.API.Core.Migrations
Assembly: LemonEdge.API.Core.Migrations.dll
Syntax
public class CustomUpgradeHelper
Constructors
CustomUpgradeHelper(ICustomUpgradeVersionHandler, IEntityUpdater, IReadOnlyCache, UserInfo, IServiceContext, Func<Task<IEntityUpdater>>, Func<ISQLWrapper, Task>, Func<string, Assembly, Task>, Func<string, Task>)
Creates a new custom upgrade helper
Declaration
public CustomUpgradeHelper(ICustomUpgradeVersionHandler upgradeVersionHandler, IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, IServiceContext services, Func<Task<IEntityUpdater>> getUpdater, Func<ISQLWrapper, Task> processSQLWrapper, Func<string, Assembly, Task> processImportFile, Func<string, Task> processSQL)
Parameters
Type | Name | Description |
---|---|---|
ICustomUpgradeVersionHandler | upgradeVersionHandler | An upgrade handler so consumers can check versions and if updates are required |
IEntityUpdater | updater | The current update context |
IReadOnlyCache | cache | The current local cache |
UserInfo | user | The current logged in user |
IServiceContext | services | The services demanded from the IServiceProvider |
Func<Task<IEntityUpdater>> | getUpdater | A function that returns a new update context as required |
Func<ISQLWrapper, Task> | processSQLWrapper | A function that takes a configured sql wrapper and processes it to make sure the wrapped sql is committed to the database to |
Func<string, Assembly, Task> | processImportFile | A function that takes an xml export file genenerated from LemonEdge and imports it into the system |
Func<string, Task> | processSQL |
Properties
Cache
The current local cache
Declaration
public IReadOnlyCache Cache { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCache |
Services
The services demanded from the IServiceProvider
Declaration
public IServiceContext Services { get; }
Property Value
Type | Description |
---|---|
IServiceContext |
Updater
The current update context
Declaration
public IEntityUpdater Updater { get; }
Property Value
Type | Description |
---|---|
IEntityUpdater |
User
The current logged in user
Declaration
public UserInfo User { get; }
Property Value
Type | Description |
---|---|
UserInfo |
VersionHandler
An upgrade handler so consumers can check versions and if updates are required
Declaration
public ICustomUpgradeVersionHandler VersionHandler { get; }
Property Value
Type | Description |
---|---|
ICustomUpgradeVersionHandler |
Methods
ExecuteCustomSQL(string)
Declaration
public Task ExecuteCustomSQL(string sql)
Parameters
Type | Name | Description |
---|---|---|
string | sql |
Returns
Type | Description |
---|---|
Task |
GetUpdater()
Returns a new update context
Declaration
public Task<IEntityUpdater> GetUpdater()
Returns
Type | Description |
---|---|
Task<IEntityUpdater> | A new update context |
ImportXMLFile(string, Assembly)
Given an export file genenerated from LemonEdge, this imports it into the system
Declaration
public Task ImportXMLFile(string resourceName, Assembly resourceAssembly)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the embedded import file in the assembly |
Assembly | resourceAssembly | The assembly the resource file is embedded in |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of this operation |
ProcessSQLWrapperFromImport(ISQLWrapper)
Takes a configured sql wrapper and processes it to make sure the wrapped sql is committed to the database to
Declaration
public Task ProcessSQLWrapperFromImport(ISQLWrapper wrapper)
Parameters
Type | Name | Description |
---|---|---|
ISQLWrapper | wrapper | A sql wrapper that has had its sql modified |
Returns
Type | Description |
---|---|
Task | A task indicating completion of the operation |