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 entityInherited Members
Namespace: LemonEdge.API.Descriptors
Assembly: LemonEdge.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.Instance.GetDescriptor(typeof(API.Entities.IMyWidget2))
};
public override string ItemName => "MyWidget";
public override string SetName => ItemName.Pluralize();
}
Constructors
ObseleteEntityDescriptor()
Declaration
protected ObseleteEntityDescriptor()
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
string |