Search Results for

    Show / Hide Table of Contents

    Class ObseleteEntityDescriptor

    Whenever an entity is no longer used in the system this class can be inherited to provide details about it so that it can be removed from the database

    If you just remove an entity then the system may be unable to upgrade the database if other entities are referred to by the now deleted entity. Database constraints may prevent them being upgraded.

    By providing the details for this old entity the system can automatically update all elements of the database and remove the old entity
    Inheritance
    System.Object
    ObseleteEntityDescriptor
    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.Core.Descriptors
    Assembly: API.dll
    Syntax
    public abstract class ObseleteEntityDescriptor
    Remarks

    For instance if you removed an obsolete entity called MyWidget:

    public class MyWidgetObsolete : LemonEdge.Core.Descriptors.ObseleteEntityDescriptor
    {
        public override string TableName => "dbo.MyWidgets";
    
        public override Type OriginalBaseType => typeof(API.Core.IBaseEntity);
    
        public override IEnumerable<EntityDescriptor> ProcessBeforeDescriptors =>
            new EntityDescriptor[]
            {
                EntityDescriptorFactory.GetDescriptor(typeof(API.Entities.IMyWidget2))
            };
    
        public override string ItemName => "MyWidget";
    
        public override string SetName => ItemName.Pluralize();
    
    }

    Properties

    ItemName

    The original individual item name for this entity. WOuld have been set from ItemName

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

    OriginalBaseType

    Indicates the base core type this entity originally inherited from. Either IBaseEntity or IBaseEntityWithPermissions

    The system uses this to know if it also has to delete any associated permission tables or not

    Declaration
    public abstract Type OriginalBaseType { get; }
    Property Value
    Type Description
    System.Type

    ProcessAfterDescriptors

    Indicates the removal of this entity should be processed after the specified entities are processed during an upgrade

    Declaration
    public virtual IEnumerable<EntityDescriptor> ProcessAfterDescriptors { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<EntityDescriptor>

    ProcessBeforeDescriptors

    Indicates the removal of this entity should be processed before the specified entities are processed during an upgrade

    Declaration
    public virtual IEnumerable<EntityDescriptor> ProcessBeforeDescriptors { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<EntityDescriptor>

    SetName

    The original set name for a collection of these entities. WOuld have been set from SetName

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

    TableName

    The original name for the table that held this obsolete entity. Would have been specified originally using TableName

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

    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.