Search Results for

    Show / Hide Table of Contents

    Class XMLImporter

    A class designed to import xml files generated by the LemonEdge system itself for exportable entities, such as ISQLWrapper

    Inheritance
    System.Object
    XMLImporter
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.Entities.Processors.Importing
    Assembly: 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

    System.Func<System.Threading.Tasks.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, Boolean, Boolean, 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, CancellationToken cancel = default(CancellationToken))
    Parameters
    Type Name Description
    IEntityUpdater updater

    The current context of updater to use for importing/updating and committing the data

    System.Boolean 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 updater context, but is not saved. That needs to be done externally by the calling function.

    System.Boolean validate
    System.Threading.CancellationToken cancel

    A cancellation token to stop importing the data

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.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
    System.Byte[] data

    The byte array of a single xml file to import

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonEdge Technology. All rights reserved.