Search Results for

    Show / Hide Table of Contents

    Interface IEntityDescriptorFactory

    Namespace: LemonEdge.API.Descriptors
    Assembly: LemonEdge.API.dll
    Syntax
    public interface IEntityDescriptorFactory

    Properties

    IsLoaded

    Returns whether this factory has any EntityDescriptors cached.

    Declaration
    bool IsLoaded { get; }
    Property Value
    Type Description
    bool

    Options

    Accessor for the configuration options for the factory.

    Declaration
    EntityDescriptorFactoryOptions Options { get; set; }
    Property Value
    Type Description
    EntityDescriptorFactoryOptions

    Methods

    CreateDescriptor()

    Creates a default EntityDescriptor

    Declaration
    EntityDescriptor CreateDescriptor()
    Returns
    Type Description
    EntityDescriptor

    GetComplexTypeDescriptor(Type)

    Returns the ComplexTypeDescriptor for the specified instance of a complex type

    Declaration
    ComplexTypeDescriptor GetComplexTypeDescriptor(Type type)
    Parameters
    Type Name Description
    Type type

    The complex type.

    Returns
    Type Description
    ComplexTypeDescriptor

    The ComplexTypeDescriptor for the specified instance of a complex type

    GetComplexTypes()

    Returns a ComplexTypeDescriptor for every complex type found in the system including through custom objects and addins

    Declaration
    IEnumerable<ComplexTypeDescriptor> GetComplexTypes()
    Returns
    Type Description
    IEnumerable<ComplexTypeDescriptor>

    A ComplexTypeDescriptor for every complex type found in the system including through custom objects and addins

    GetDescriptor(IBaseEntity)

    Returns the EntityDescriptor for the specified instance of an entity

    Declaration
    EntityDescriptor GetDescriptor(IBaseEntity item)
    Parameters
    Type Name Description
    IBaseEntity item

    The instance of an entity to return its associated EntityDescriptor for

    Returns
    Type Description
    EntityDescriptor

    The EntityDescriptor for the specified instance of an entity

    GetDescriptor(Guid, Guid)

    Returns the EntityDescriptor for the specified type, and specified sub type (if looking for a replicated EntityDescriptor)

    Declaration
    EntityDescriptor GetDescriptor(Guid id, Guid forType = default)
    Parameters
    Type Name Description
    Guid id

    The unique global id of an entity type

    Guid forType

    The unique global id of an entity that is the sub type for the EntityDescriptor - used when looking for a replicated EntityDescriptor

    Returns
    Type Description
    EntityDescriptor

    GetDescriptor(string)

    Returns the EntityDescriptor for the specified uniqueKey of an EntityDescriptor

    Declaration
    EntityDescriptor GetDescriptor(string uniqueKey)
    Parameters
    Type Name Description
    string uniqueKey

    The UniqueKey of an EntityDescriptor

    Returns
    Type Description
    EntityDescriptor

    The EntityDescriptor for the specified uniqueKey of an EntityDescriptor

    GetDescriptor(Type, Guid)

    Returns the EntityDescriptor for the specified type, and specified sub type (if looking for a replicated EntityDescriptor)

    Declaration
    EntityDescriptor GetDescriptor(Type t, Guid forType = default)
    Parameters
    Type Name Description
    Type t

    The type of an entity (either its interface or class type)

    Guid forType

    The unique global id of an entity that is the sub type for the EntityDescriptor - used when looking for a replicated EntityDescriptor

    Returns
    Type Description
    EntityDescriptor

    GetDescriptor<T>(Guid)

    Returns the EntityDescriptor for the specified type, and specified sub type (if looking for a replicated EntityDescriptor).

    Declaration
    EntityDescriptor GetDescriptor<T>(Guid forType = default)
    Parameters
    Type Name Description
    Guid forType

    The unique global id of an entity that is the sub type for the EntityDescriptor - used when looking for a replicated EntityDescriptor.

    Returns
    Type Description
    EntityDescriptor
    Type Parameters
    Name Description
    T

    The type of an entity (either its interface or class type).

    GetDescriptors(Action)

    Returns an EntityDescriptor for each entity within the system including those defined through custom objects and addins

    This also includes replicated EntityDescriptors - in other words the complete set of all EntityDescriptors available within the system

    Declaration
    IEnumerable<EntityDescriptor> GetDescriptors(Action callback = null)
    Parameters
    Type Name Description
    Action callback
    Returns
    Type Description
    IEnumerable<EntityDescriptor>

    An EntityDescriptor for each entity within the system including those defined through custom objects and addins

    GetDescriptors(IEnumerable<Assembly>)

    Returns all EntityDescriptor restricted to just those for a particular database.

    This is required for task services and other processes that connect to multiple databases at once

    Declaration
    IEnumerable<EntityDescriptor> GetDescriptors(IEnumerable<Assembly> assemblies)
    Parameters
    Type Name Description
    IEnumerable<Assembly> assemblies

    The database custom assemblies.

    Returns
    Type Description
    IEnumerable<EntityDescriptor>

    All EntityDescriptor restricted to just those for a particular database.

    GetKnownTypes()

    Returns all known entity types and enum types within all loaded EntityDescriptors in the system

    Used for serialization

    Declaration
    IEnumerable<Type> GetKnownTypes()
    Returns
    Type Description
    IEnumerable<Type>

    All known entity types and enum types within all loaded EntityDescriptors in the system

    IsPartOfSpecificAssembly(Guid, IEnumerable<Assembly>)

    It's possible using custom objects (which dynamically create dlls) that we have the same object design (using the same typeids -> sharedkey) in two databases we can only have one entity descriptor for that typeid, so we store any other assemblies that reference the same typeid then here we can say that if specific dlls are requested we can return that typeid if it is part of our stored assemblies

    Declaration
    bool IsPartOfSpecificAssembly(Guid typeID, IEnumerable<Assembly> customAssemblies)
    Parameters
    Type Name Description
    Guid typeID

    The unique global type of an entity that needs to be checked if it is defined in the list of assemblies

    IEnumerable<Assembly> customAssemblies

    A list of assemblies to check if the specified entity type is defined within it

    Returns
    Type Description
    bool

    True if the unique global id of the entity descriptor is defined as an entity in the specified list of assemblies

    ReplicateEntityDescriptor(EntityDescriptor, EntityDescriptor)

    Declaration
    EntityDescriptor ReplicateEntityDescriptor(EntityDescriptor replicatingDescriptor, EntityDescriptor mainDescriptor)
    Parameters
    Type Name Description
    EntityDescriptor replicatingDescriptor
    EntityDescriptor mainDescriptor
    Returns
    Type Description
    EntityDescriptor

    Extension Methods

    EntityDescriptorFactoryExtensions.FromTypeName(IEntityDescriptorFactory, string)
    EntityDescriptorFactoryExtensions.GetAllDependantEntities(IEntityDescriptorFactory, EntityDescriptor)
    EntityDescriptorFactoryExtensions.GetCachedDescriptors(IEntityDescriptorFactory)
    EntityDescriptorFactoryExtensions.GetDescriptorsInSaveOrder(IEntityDescriptorFactory, IEnumerable<EntityDescriptor>)
    EntityDescriptorFactoryExtensions.GetDirectDependantEntities(IEntityDescriptorFactory, EntityDescriptor, bool)
    EntityDescriptorFactoryExtensions.GetItemsInTypeReverseSaveOrder(IEntityDescriptorFactory, IReadOnlyCollection<IBaseEntity>)
    EntityDescriptorFactoryExtensions.GetItemsInTypeSaveOrder(IEntityDescriptorFactory, IReadOnlyCollection<IBaseEntity>)
    EntityDescriptorFactoryExtensions.GetTypeDistinctDescriptors(IEntityDescriptorFactory)
    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.