Class EntityDefinition
The main attribute for LemonEdge indicating this interface holds a definition of an entity that should be managed by LemonEdge.
This must be marked against an interface, the system will find the associated entity class implementation, or will create one dynamically if one does not exist
The system will automatically handle the back-end work for this entity such as creating database tables, functions/stored procedures, web service controllers, etc
If you changes the TableName, ItemName, or SetName then you need to create a EntityDefintionOldInfo with the old values so the system knows what to rename in the database
Any entity marked with this will have an EntityDescriptor created for it by the system during runtime that holds the description of everything to do with this entity.
This includes the InterfaceType and EntityType that can be used for interacting with the data held by this type
Inheritance
Inherited Members
Namespace: LemonEdge.API.Attributes
Assembly: API.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = false, AllowMultiple = false)]
public sealed class EntityDefinition : Attribute
Constructors
EntityDefinition(EntityID, String, String)
Creates a new entity definition with the specified globally unique id
Declaration
public EntityDefinition(EntityID id, string tableName, string itemName)
Parameters
Type | Name | Description |
---|---|---|
EntityID | id | The globally unique id for this specific entity type |
System.String | tableName | The unique name to be used when creating this table in the database |
System.String | itemName | The unique name for referring to an individual instance of this entity in the system. If not provided SetName will automatically be calculated using Pluralize(String) |
EntityDefinition(String, String, String)
Creates a new entity definition with the specified globally unique id
Declaration
public EntityDefinition(string guidTypeID, string tableName, string itemName)
Parameters
Type | Name | Description |
---|---|---|
System.String | guidTypeID | The globally unique id for this specific entity type |
System.String | tableName | The unique name to be used when creating this table in the database |
System.String | itemName | The unique name for referring to an individual instance of this entity in the system. If not provided SetName will automatically be calculated using Pluralize(String) |
Properties
AutoClusteredIndexes
Indicates the system should automatically create the clustered indexes for the table.
True by default, but can be turned off for large data tables for permormance and reporting reasons
Declaration
public bool AutoClusteredIndexes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoCreatePrimaryIndex
Indicates the system should automatically create the primary index on the table.
True by default, but can be turned off for large data tables for permormance and reporting reasons
Declaration
public bool AutoCreatePrimaryIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
CustomToString
Indicates the class implementation of this entity has its own custom string implementation and the system should not automatically generate one returning the label property value
Declaration
public bool CustomToString { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DontPromoteFromCanvas
Indicates this entity should not be promoted from a canvas to the live system. By default this is false, and all items can be promoted from a canvas to th live system.
Declaration
public bool DontPromoteFromCanvas { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HelpURL
An optional url that holds a help file describing the purpose and functionality of this entity record
Declaration
public string HelpURL { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IsStandingDataEntity
Indicates this entity is part of the standing data/configuation for the system It should be loaded on application startup as part of the cache. Do not use for tables of large data sets
Declaration
public bool IsStandingDataEntity { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemName
The name the system should use when referring to an instance of this entity.
This should contain alpha numerical characters only, not spaces or other special characters
Declaration
public string ItemName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LabelColumn
If this entity is displayed as a main entity in the system, such as being able to be opened and viewed by the user, then this holds the property to be used as a label.
Whenever a property is a relationship the system also creates an _Label column for that property id that holds the label of that related item using this property
For instance the EmailLogin is the label for a user, and thus whenever a user is viewed in a grid, or opened as a tab this property is used to show which user it is
Declaration
public string LabelColumn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ReplicateForEachDescriptorType
Indicates this descriptor should actually be created for each descriptor
Must have a property marked with UseForReplicatingDescriptorType=true on a Guid property that will hold the related descriptor id
System will create a table for each entity defined in the system. For example, permissions uses this creating a matching x_Permissions table for each entity in the system
Declaration
public Type ReplicateForEachDescriptorType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
SelectWithNoLock
Indicates selecting data from this table should be done with no lock flag or not. By default this is false.
This is used for tables that do not allow record updates and for performance reasons.
Declaration
public bool SelectWithNoLock { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SetName
The name the system should use when referring to a collection of these entities
This should contain alpha numerical characters only, not spaces or other special characters
Declaration
public string SetName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TableName
Holds the name of the actual table in the database that holds all records for this type.
System LemonEdge tables always start with LT_
Declaration
public string TableName { get; }
Property Value
Type | Description |
---|---|
System.String |
TypeID
Each entity in the system has a unique global hardcoded ID. This is used in items that refer to any record such as permissions, which will hold the Entity Type ID and Entity ID
Declaration
public Guid TypeID { get; }
Property Value
Type | Description |
---|---|
System.Guid |