Search Results for

    Show / Hide Table of Contents

    Class CSVImporter.MappedColumnData

    A class holding a single cell of data to be imported for a specific row (CSVImporter.MappedData) and column

    Inheritance
    System.Object
    CSVImporter.MappedColumnData
    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 MappedColumnData

    Constructors

    MappedColumnData(String)

    Creates a new mapped column data from the specified raw string value from the source file

    Declaration
    public MappedColumnData(string rawData)
    Parameters
    Type Name Description
    System.String rawData

    Fields

    NullValue

    The contant used to actually clear the value of a property - <NULL>

    If a cell of data is just blank it is ignored and not imported

    Declaration
    public const string NullValue = "<NULL>"
    Field Value
    Type Description
    System.String

    Properties

    IsRawValueBlank

    Indicates if the specified raw string value is null or empty, effectively blank

    Declaration
    public bool IsRawValueBlank { get; }
    Property Value
    Type Description
    System.Boolean

    IsRawValueSetToNull

    Indicates if the specified raw string value is equal to NullValue

    Declaration
    public bool IsRawValueSetToNull { get; }
    Property Value
    Type Description
    System.Boolean

    RawData

    The raw value from the source file to import

    Declaration
    public string RawData { get; }
    Property Value
    Type Description
    System.String

    Methods

    ConvertRawValue<T>(T)

    Converts the raw value to the expected data type. If the string raw value can not be converted to the type, then the defaultIfNotValid is returned instead

    Declaration
    public T ConvertRawValue<T>(T defaultIfNotValid)
    Parameters
    Type Name Description
    T defaultIfNotValid

    A value to return if the original raw string value is not valid for converting to the specified type

    Returns
    Type Description
    T

    The raw value converted to the expected data type. If the string raw value can not be converted to the type, then the defaultIfNotValid is returned instead

    Type Parameters
    Name Description
    T

    The type to return the data as

    GetAutoKeyRef(IDataMappingPropertyBase)

    If the value being imported is an auto increment key, and the raw value is not an integer but a string, then the system needs the string value for other

    imports to refer to it by that auto-increment key value.

    Declaration
    public string GetAutoKeyRef(IDataMappingPropertyBase header)
    Parameters
    Type Name Description
    IDataMappingPropertyBase header

    A data mapping for this header

    Returns
    Type Description
    System.String

    If this value is for an auto increment column, this holds any string key value in the import so other import lines can refer to it by that key

    GetValue(IEnumerable<IDataMappingPropertyBase>, (Boolean Loaded, Boolean SetToNull, Boolean Ignore, Object Value)[], IFormulaImporterContext, IDataMappingPropertyBase, Dictionary<String, Guid>)

    Returns the value of this raw string value. Takes account of any data mapping overrides or formulas to retrieve the correct value

    Declaration
    public Task<object> GetValue(IEnumerable<IDataMappingPropertyBase> headers, (bool Loaded, bool SetToNull, bool Ignore, object Value)[] otherData, IFormulaImporterContext retriever, IDataMappingPropertyBase header, Dictionary<string, Guid> autoIncRefs)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<IDataMappingPropertyBase> headers
    System.ValueTuple<System.Boolean, System.Boolean, System.Boolean, System.Object>[] otherData
    IFormulaImporterContext retriever

    A formula context for evaluating any OverrideValueFormula

    IDataMappingPropertyBase header

    The header mapping for this column

    System.Collections.Generic.Dictionary<System.String, System.Guid> autoIncRefs

    A dictionary of all custom auto increment keys that have been imported so far

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The translated, converted, or evaluated value this raw string holds

    IsAutoKeyRef(IDataMappingPropertyBase)

    Returns true if the header is an autoincrement column reference

    Declaration
    public static bool IsAutoKeyRef(IDataMappingPropertyBase header)
    Parameters
    Type Name Description
    IDataMappingPropertyBase header

    The header to evaluate if the column reference is auto increment or not

    Returns
    Type Description
    System.Boolean

    True if the header is an autoincrement column reference

    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 © LemonTree Software Ltd. All rights reserved.