Class EntityDefinitionAttribute
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 change the TableName, ItemName, or SetName then you need to create a EntityDefinitionOldInfoAttribute 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
Inherited Members
Namespace: LemonEdge.API.Attributes
Assembly: LemonEdge.API.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface, Inherited = false)]
public sealed class EntityDefinitionAttribute : Attribute
Constructors
EntityDefinitionAttribute(EntityID, string, string)
Creates a new entity definition with the specified globally unique id
Declaration
public EntityDefinitionAttribute(EntityID id, string tableName, string itemName)
Parameters
Type | Name | Description |
---|---|---|
EntityID | id | The globally unique id for this specific entity type |
string | tableName | The unique name to be used when creating this table in the database |
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) |
EntityDefinitionAttribute(string, string, string)
Creates a new entity definition with the specified globally unique id
Declaration
public EntityDefinitionAttribute(string guidTypeID, string tableName, string itemName)
Parameters
Type | Name | Description |
---|---|---|
string | guidTypeID | The globally unique id for this specific entity type |
string | tableName | The unique name to be used when creating this table in the database |
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
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 |
---|---|
bool |
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 the live system.
Declaration
public bool DontPromoteFromCanvas { get; set; }
Property Value
Type | Description |
---|---|
bool |
HasClusteredPrimaryKey
Declaration
public bool HasClusteredPrimaryKey { get; set; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
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 |
---|---|
bool |
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 |
---|---|
string |
LabelColumn
If this entity is displayed as a main entity in the system, such as one 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 a _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 |
---|---|
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 |
---|---|
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 |
---|---|
bool |
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 |
---|---|
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 |
---|---|
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 |
---|---|
Guid |
UseUserDataTable
Indicates the storage of this data should be held in a custom user data table
This has poor performance, but does mean schema changes can be made live and the database doesn't need to be upgraded
Should mostly be used via customobjectsDeclaration
public bool UseUserDataTable { get; set; }
Property Value
Type | Description |
---|---|
bool |