Class EntityPropertyAttribute
Defines how this property should be handled when maintained as a column in sql server
Inherited Members
Namespace: LemonEdge.API.Attributes
Assembly: LemonEdge.API.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public sealed class EntityPropertyAttribute : Attribute
Constructors
EntityPropertyAttribute(SQLType, bool)
Defines the property with the specified sql type, whether it is nullable
Declaration
public EntityPropertyAttribute(SQLType type, bool nullable)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
bool | nullable | Indicates if the property should be nullable or not in sql |
EntityPropertyAttribute(SQLType, bool, bool)
Defines the property with the specified sql type, whether it is nullable, and whether it should be marked as sparse
Declaration
public EntityPropertyAttribute(SQLType type, bool nullable, bool sparse)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
bool | nullable | Indicates if the property should be nullable or not in sql |
bool | sparse | Indicates if this column should be stored as a sparse column in sql |
EntityPropertyAttribute(SQLType, bool, string)
Defines the property with the specified sql type, whether it is nullable, and what default sql to use when upgrading the column to not nullable
Declaration
public EntityPropertyAttribute(SQLType type, bool nullable, string defaultSQL)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
bool | nullable | Indicates if the property should be nullable or not in sql |
string | defaultSQL | If this column is being upgraded from nullable to not nullable, this is the default sql to apply to that column when altering it |
EntityPropertyAttribute(SQLType, short, bool)
Defines the property with the specified sql type with a specfied length (required if the sql type is of string type), whether it is nullable
Declaration
public EntityPropertyAttribute(SQLType type, short length, bool nullable)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | length | The length to use for the string column. i.e. if the type is NVarChar then a length of 30, would be stored as nvarchar(30). If no length is supplied then nvarchar(max) is used. |
bool | nullable | Indicates if the property should be nullable or not in sql |
EntityPropertyAttribute(SQLType, short, bool, bool)
Defines the property with the specified sql type with a specfied length (required if the sql type is of string type), whether it is nullable
Declaration
public EntityPropertyAttribute(SQLType type, short length, bool nullable, bool sparse)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | length | The length to use for the string column. i.e. if the type is NVarChar then a length of 30, would be stored as nvarchar(30). If no length is supplied then nvarchar(max) is used. |
bool | nullable | Indicates if the property should be nullable or not in sql |
bool | sparse | Indicates if this column should be stored as a sparse column in sql |
EntityPropertyAttribute(SQLType, short, bool, string)
Defines the property with the specified sql type with a specfied length (required if the sql type is of string type), whether it is nullable, and what default sql to use when upgrading the column to not nullable
Declaration
public EntityPropertyAttribute(SQLType type, short length, bool nullable, string defaultSQL)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | length | The length to use for the string column. i.e. if the type is NVarChar then a length of 30, would be stored as nvarchar(30). If no length is supplied then nvarchar(max) is used. |
bool | nullable | Indicates if the property should be nullable or not in sql |
string | defaultSQL | If this column is being upgraded from nullable to not nullable, this is the default sql to apply to that column when altering it |
EntityPropertyAttribute(SQLType, short, bool, string, bool)
Defines the property with the specified sql type with a specfied length (required if the sql type is of string type), whether it is nullable, and what default sql to use when upgrading the column to not nullable
Declaration
public EntityPropertyAttribute(SQLType type, short length, bool nullable, string defaultSQL, bool sparse)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | length | The length to use for the string column. i.e. if the type is NVarChar then a length of 30, would be stored as nvarchar(30). If no length is supplied then nvarchar(max) is used. |
bool | nullable | Indicates if the property should be nullable or not in sql |
string | defaultSQL | If this column is being upgraded from nullable to not nullable, this is the default sql to apply to that column when altering it |
bool | sparse | Indicates if this column should be stored as a sparse column in sql |
EntityPropertyAttribute(SQLType, short, short, bool)
Defines the property with the specified sql type and its precision and scale (when a decimal type), whether it is nullable
Declaration
public EntityPropertyAttribute(SQLType type, short precision, short scale, bool nullable)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | precision | The precision component of the decimal type, giving rise to decimal(
|
short | scale | The scale component of the decimal type, giving rise to decimal( |
bool | nullable | Indicates if the property should be nullable or not in sql |
EntityPropertyAttribute(SQLType, short, short, bool, bool)
Defines the property with the specified sql type and its precision and scale (when a decimal type), whether it is nullable, and whether it should be marked as sparse
Declaration
public EntityPropertyAttribute(SQLType type, short precision, short scale, bool nullable, bool sparse)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | precision | The precision component of the decimal type, giving rise to decimal(
|
short | scale | The scale component of the decimal type, giving rise to decimal( |
bool | nullable | Indicates if the property should be nullable or not in sql |
bool | sparse | Indicates if this column should be stored as a sparse column in sql |
EntityPropertyAttribute(SQLType, short, short, bool, bool, string)
Defines the property with the specified sql type and its precision and scale (when a decimal type), whether it is nullable, whether it should be marked as sparse, and what default sql to use when upgrading the column to not nullable
Declaration
public EntityPropertyAttribute(SQLType type, short precision, short scale, bool nullable, bool sparse, string defaultSQL)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | precision | The precision component of the decimal type, giving rise to decimal(
|
short | scale | The scale component of the decimal type, giving rise to decimal( |
bool | nullable | Indicates if the property should be nullable or not in sql |
bool | sparse | Indicates if this column should be stored as a sparse column in sql |
string | defaultSQL | If this column is being upgraded from nullable to not nullable, this is the default sql to apply to that column when altering it |
EntityPropertyAttribute(SQLType, short, short, bool, string)
Defines the property with the specified sql type and its precision and scale (when a decimal type), whether it is nullable, and what default sql to use when upgrading the column to not nullable
Declaration
public EntityPropertyAttribute(SQLType type, short precision, short scale, bool nullable, string defaultSQL)
Parameters
Type | Name | Description |
---|---|---|
SQLType | type | The sql type used to store the value of this property in sql |
short | precision | The precision component of the decimal type, giving rise to decimal(
|
short | scale | The scale component of the decimal type, giving rise to decimal( |
bool | nullable | Indicates if the property should be nullable or not in sql |
string | defaultSQL | If this column is being upgraded from nullable to not nullable, this is the default sql to apply to that column when altering it |
Properties
Collation
If the sql type is of string type, this is the collation to use. If left blank this will default to the collation of the database itself
Declaration
public string Collation { get; set; }
Property Value
Type | Description |
---|---|
string |
ColumnName
The name of the column to be created in sql for this property.
If blank this defaults to the actual name of the property itself
Declaration
public string ColumnName { get; set; }
Property Value
Type | Description |
---|---|
string |
Formula
Indicates this property should always be evaluated as a formula dynamically by the system
Declaration
public string Formula { get; set; }
Property Value
Type | Description |
---|---|
string |
FriendlyLabel
The friendly label to use when displaying this property value in the UI.
If blank this default to the name of the property itself using the Wordify(string) and by removing any trailing ID
Declaration
public string FriendlyLabel { get; set; }
Property Value
Type | Description |
---|---|
string |
IsDate
If this is a datetimeoffset, this indicates we only require it for the date component, and the time should always be 0 so dates match when filtered
Declaration
public bool IsDate { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsEntityTypeLink
Indicates this property is a guid that holds a link to the unique global ids of entity types themselves.
This is often used in conjunction with a property that holds the id to an item (using EntityLinkToAnyParentRelationshipAttribute) where this property holds the type of entity the other holds the id for
Declaration
public bool IsEntityTypeLink { get; set; }
Property Value
Type | Description |
---|---|
bool |
OldColumnNames
If this column has been upgraded and has had its name changed, this is a list of all the old column names so the system can upgrade the appropriate tables and queries
Declaration
public string[] OldColumnNames { get; set; }
Property Value
Type | Description |
---|---|
string[] |
Type
The sql type used to store this property value in sql server
Declaration
public ColumnType Type { get; }
Property Value
Type | Description |
---|---|
ColumnType |
UseForReplicatingDescriptorType
Indicates this property belongs to a descriptor that is replicated for each descriptor in the system Essentially means this property is "virtual" and maintained by the system, the actual table won't hold this column, the functions will. The column holds the id of the entity type this descriptor is replicated for. For example, Permissions uses this to indicate the EntityTypeID is the property that should be used to replicate the permissions table for each descriptor
Declaration
public bool UseForReplicatingDescriptorType { get; set; }
Property Value
Type | Description |
---|---|
bool |