Search Results for

    Show / Hide Table of Contents

    Interface IEntityWriter

    Namespace: LemonEdge.API.Core.Writers
    Assembly: LemonEdge.API.dll
    Syntax
    public interface IEntityWriter

    Methods

    AddAttributes(IEnumerable<CustomAttributeData>, Func<Type, bool>, string)

    Declaration
    string AddAttributes(IEnumerable<CustomAttributeData> attributes, Func<Type, bool> shouldAddAttributeType, string tabPrefix)
    Parameters
    Type Name Description
    IEnumerable<CustomAttributeData> attributes
    Func<Type, bool> shouldAddAttributeType
    string tabPrefix
    Returns
    Type Description
    string

    AddFileFooterAndCloseNamespaces(ClassFileWriter)

    Closes the [LemonEdge.Entities] namespace started by EntityWriter.AddFileHeadersAndNamespace

    Declaration
    void AddFileFooterAndCloseNamespaces(ClassFileWriter writer)
    Parameters
    Type Name Description
    ClassFileWriter writer

    The writer to close the namespace on

    AddFileHeaders(ClassFileWriter, string)

    Adds the standard using statements required for the entity defintion code to work correctly in LemonEdge, and starts the namespace [LemonEdge.Entities]

    Declaration
    void AddFileHeaders(ClassFileWriter writer, string customUsing)
    Parameters
    Type Name Description
    ClassFileWriter writer

    The writer to add the using statements to

    string customUsing

    Optionally any custom using statements for the entity to reference specified types

    WriteFile(EntityDescriptor, string, string)

    Writes a whole file for the specified entity descriptor interface with an optional custom using

    Declaration
    string WriteFile(EntityDescriptor descriptor, string customUsing, string @namespace = "LemonEdge.Entities")
    Parameters
    Type Name Description
    EntityDescriptor descriptor

    An entitydescriptor describing the interface. This is loaded dynamically from an interface type, or for a custom object from CreateTempFrom(ICustomObject, IEnumerable<ICustomObjectProperty>)

    string customUsing

    Optionally any custom using statements for the entity to reference specified types

    string namespace
    Returns
    Type Description
    string

    A string of the complete c# code for this entity

    WriteProperty(string, Type, Type, string, short, PropertyInfo, ColumnType, bool, bool, bool, ICustomObjectProperty)

    Declaration
    string WriteProperty(string propName, Type colType, Type nullableType, string typeModifier, short currentIndent, PropertyInfo forValidations, ColumnType colDef, bool trackChanges, bool isReplicatedKey, bool isSilentLabel, ICustomObjectProperty forCustomValidation)
    Parameters
    Type Name Description
    string propName
    Type colType
    Type nullableType
    string typeModifier
    short currentIndent
    PropertyInfo forValidations
    ColumnType colDef
    bool trackChanges
    bool isReplicatedKey
    bool isSilentLabel
    ICustomObjectProperty forCustomValidation
    Returns
    Type Description
    string

    WriteToFile(ClassFileWriter, EntityDescriptor, IEnumerable<ICustomObjectProperty>)

    Write the entity class defintion for an existing LemonEdge entity Interface (obtained either from custom .net code (must be marked with EntityDefinitionAttribute) or a ICustomObject)

    Declaration
    void WriteToFile(ClassFileWriter writer, EntityDescriptor descriptor, IEnumerable<ICustomObjectProperty> props)
    Parameters
    Type Name Description
    ClassFileWriter writer

    The writer to add the generated code to

    EntityDescriptor descriptor

    An entitydescriptor describing the interface. This is loaded dynamically from an interface type, or for a custom object from CreateTempFrom(ICustomObject, IEnumerable<ICustomObjectProperty>)

    IEnumerable<ICustomObjectProperty> props

    If this interface comes from a ICustomObject then this optionally holds the custom object properties, used to provide custom attributes and validation to the generated interface

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.