Class CustomUpgradeHelper
Inheritance
Inherited Members
Namespace: LemonEdge.API.Migrations.Core
Assembly: API.dll
Syntax
public class CustomUpgradeHelper
Constructors
CustomUpgradeHelper(ICustomUpgradeVersionHandler, IEntityUpdater, IReadOnlyCache, UserInfo, Func<Task<IEntityUpdater>>, Func<ISQLWrapper, Task>, Func<String, Assembly, Task>)
Creates a new custom upgrade helper
Declaration
public CustomUpgradeHelper(ICustomUpgradeVersionHandler upgradeVersionHandler, IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, Func<Task<IEntityUpdater>> getUpdater, Func<ISQLWrapper, Task> processSQLWrapper, Func<string, Assembly, Task> processImportFile)
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 |
| System.Func<System.Threading.Tasks.Task<IEntityUpdater>> | getUpdater | A function that returns a new update context as required |
| System.Func<ISQLWrapper, System.Threading.Tasks.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 |
| System.Func<System.String, System.Reflection.Assembly, System.Threading.Tasks.Task> | processImportFile | A function that takes an xml export file genenerated from LemonEdge and imports it into the system |
Properties
Cache
The current local cache
Declaration
public IReadOnlyCache Cache { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCache |
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
GetUpdater()
Returns a new update context
Declaration
public Task<IEntityUpdater> GetUpdater()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.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 |
|---|---|---|
| System.String | resourceName | The name of the embedded import file in the assembly |
| System.Reflection.Assembly | resourceAssembly | The assembly the resource file is embedded in |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.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 |
|---|---|
| System.Threading.Tasks.Task | A task indicating completion of the operation |