Class XMLImporter
A class designed to import xml files generated by the LemonEdge system itself for exportable entities, such as ISQLWrapper
Implements
Inherited Members
Namespace: LemonEdge.API.Core.Processors.Importing
Assembly: LemonEdge.API.dll
Syntax
public class XMLImporter : IImporter
Constructors
XMLImporter(UserInfo, IReadOnlyCache, IProgressReporter, Func<Task<IEntityUpdater>>)
Creates a new xml file importer with the specified mapping
Declaration
public XMLImporter(UserInfo user, IReadOnlyCache cache, IProgressReporter reporter, Func<Task<IEntityUpdater>> getUpdater)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The current logged in user |
IReadOnlyCache | cache | A local cache |
IProgressReporter | reporter | A class for reporting the progress/status of the import to the client, or a log |
Func<Task<IEntityUpdater>> | getUpdater | A function that returns a new updater context for retrieving and updating items |
Properties
ProgressReporter
An interface for reporting the progress, or status, of the import back to the client or a log
Declaration
public IProgressReporter ProgressReporter { get; }
Property Value
Type | Description |
---|---|
IProgressReporter |
Methods
ImportData(IEntityUpdater, bool, bool, bool, CancellationToken)
Imports the data specified using InitDataForImport(byte[]) according to the specified parameters
Leaves progress as 95% complete for saving if in batch/extra work/etc
Declaration
public Task<IEnumerable<ImportLineResultInfo>> ImportData(IEntityUpdater updater, bool saveSequentially, bool validate, bool byPassProcessors, CancellationToken cancel = default)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdater | updater | The current context of updater to use for importing/updating and committing the data |
bool | saveSequentially | Indicates the data should be saved and committed to the database. Creates a new context for each item to import.
If this is false, the data is just all imported into the |
bool | validate | |
bool | byPassProcessors | |
CancellationToken | cancel | A cancellation token to stop importing the data |
Returns
Type | Description |
---|---|
Task<IEnumerable<ImportLineResultInfo>> | A task representing the completion of the operation with a list of information for each item imported |
InitDataForImport(byte[])
Initializes this importer with the byte array of a single xml file to import
Declaration
public void InitDataForImport(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
byte[] | data | The byte array of a single xml file to import |