Search Results for

    Show / Hide Table of Contents

    Class ColumnDescriptor

    This holds the definition of a column (including its SQL definition) against an entity.

    This is defined against an entity interface on the property using the EntityProperty

    Inheritance
    System.Object
    ColumnDescriptor
    Implements
    System.IEquatable<ColumnDescriptor>
    ICloneable<ColumnDescriptor>
    ICloneable
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.Core.Descriptors
    Assembly: API.dll
    Syntax
    [DataContract]
    public class ColumnDescriptor : IEquatable<ColumnDescriptor>, ICloneable<ColumnDescriptor>, ICloneable

    Constructors

    ColumnDescriptor(String, String, String, String, ColumnType, Type)

    Creates a new description of a property

    Declaration
    public ColumnDescriptor(string columnName, string propertyName, string userFriendlyName, string description, ColumnType definition, Type type)
    Parameters
    Type Name Description
    System.String columnName

    The column name this will have to represent the property in the database. This is normally the same as the property name itself.

    System.String propertyName

    The name of the actual property against the entity

    System.String userFriendlyName

    A user friendly label for the property. If this is not set the label is the property name parsed through Wordify(String) and with any trailing ID removed

    System.String description

    A description of the property itself. Used by default as a tooltip for the value within the application.

    ColumnType definition

    The sql definition of the property representing how it will be stored in the database

    System.Type type

    The actual .net type of this property

    Fields

    LabelPropertyAppender

    Holds the name appended to a property if it also has a label. This is always the value _Label

    For instance for properties that hold ids to other items the system will also generate a property XXX_ID_Label for the XXX_ID property

    Declaration
    public const string LabelPropertyAppender = "_Label"
    Field Value
    Type Description
    System.String

    LabelSilentPropertyAppender

    Holds the name appended to a property if it also has a label and needs to be set silently without raising an IPropertyCHanged event. This is always the value _Label_Silent

    For instance for properties that hold ids that can be to any other entity instead of a particular one, the system will also generate a property XXX_ID_Label_Silent for the XXX_ID property

    This is used because the system can not load the labels and so has to do so separately, and needs to set them without marking anything as having changed against the entity
    Declaration
    public const string LabelSilentPropertyAppender = "_Label_Silent"
    Field Value
    Type Description
    System.String

    Properties

    AutoIncStart

    If set this indicates this property is an autoincrement property that the system should auto-increment on every new entity.

    The value indicates the number the auto-increment amount should initially start from if there are no existing entities, otherwise they always increment

    Set from EntityAutoIncrementColumnAttribute
    Declaration
    public long? AutoIncStart { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int64>

    ColumnName

    Holds the actual name of the column that stores this property value in the sql database

    Declaration
    public string ColumnName { get; set; }
    Property Value
    Type Description
    System.String

    Definition

    Holds the SQL Definition of this property

    Declaration
    public ColumnType Definition { get; set; }
    Property Value
    Type Description
    ColumnType

    Description

    Holds a user friendly description of this property, often used as a tooltip in the UI to explain the value

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

    HasLabelProperty

    Indicates this property also has a label property which happens if this property holds the id of a relationship to another entity that is marked as having a default label that can be used in this property

    Declaration
    public bool HasLabelProperty { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsDate

    Indicates this property is only using the date component of a datetime or datetimeoffset

    Declaration
    public bool IsDate { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsDateTime

    Indicates this property is using the full value of a datetime or datetimeoffset

    Declaration
    public bool IsDateTime { get; }
    Property Value
    Type Description
    System.Boolean

    IsEntityLink

    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 EntityLinkToAnyParentRelationship) where this property holds the type of entity the other holds the id for

    Set from IsEntityTypeLink
    Declaration
    public bool IsEntityLink { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsInherited

    Indicates if this property is part of the entity, or is inherited from a base entity

    Base entities are defined as inheriting a common interface marked with IsBaseInterfaceAttribute attribute, and they them selves inherits IBaseObject

    If this entity is an inheriting entity then it also inherits the common interface marked with IsBaseInterfaceAttribute and also inherit IInheritingObject
    Declaration
    public bool IsInherited { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsPartOfKey

    Indicates if this column is part of the unique key for this entity. An entity can have more than one column as part of the key.

    The key is indicated with the EntityKeyProperty attribute

    Declaration
    public bool IsPartOfKey { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsPivot

    Indicates this property is part of the properties definied in the pivot EntityHasPivotAttribute attribute

    Declaration
    public bool IsPivot { get; set; }
    Property Value
    Type Description
    System.Boolean

    LabelPropertyName

    Holds the name of the associated property that holds the label for the value of this property.

    Typically used if this property is an id value for another entity

    This is usually always this PropertyName + LabelPropertyAppender
    Declaration
    public string LabelPropertyName { get; set; }
    Property Value
    Type Description
    System.String

    Manadatory

    Indicates this column must have a value

    This is only enforced through the column be nullable or not. If you do not want it to be blank, or 0, etc you can use RequiredNoDefaultIDValidation

    Declaration
    public bool Manadatory { get; set; }
    Property Value
    Type Description
    System.Boolean

    OldColumnNames

    Holds a list of column names that were previously used to store the property value

    Declaration
    public string[] OldColumnNames { get; set; }
    Property Value
    Type Description
    System.String[]

    PropertyEnumType

    If the type of this property is an enum this holds the type of the enum itself

    Declaration
    public Type PropertyEnumType { get; set; }
    Property Value
    Type Description
    System.Type

    PropertyName

    Holds the actual name of the property on the entity class/interface

    Declaration
    public string PropertyName { get; set; }
    Property Value
    Type Description
    System.String

    PropertySQLMaxLength

    The max length for the sql type for this column from the Definition

    Declaration
    public int? PropertySQLMaxLength { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    PropertySQLNullable

    The nullability of the sql type for this column from the Definition

    Declaration
    public bool PropertySQLNullable { get; }
    Property Value
    Type Description
    System.Boolean

    PropertySQLPrecision

    The precision for the sql type for this column from the Definition

    Declaration
    public int? PropertySQLPrecision { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    PropertySQLScale

    The scale for the sql type for this column from the Definition

    Declaration
    public int? PropertySQLScale { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    PropertySQLType

    The sql type for this column from the Definition

    Declaration
    public SQLType PropertySQLType { get; }
    Property Value
    Type Description
    SQLType

    PropertyType

    Holds the .net framework type of this property

    Declaration
    public Type PropertyType { get; set; }
    Property Value
    Type Description
    System.Type

    PropertyTypeName

    The name of the type of property this column holds

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

    SequenceStart

    Indicates this property holds a sequence that indicates this entities sequence within a set of other entities of the same type

    The system automatically handles allowing users to move this item up/down among the set from the UI

    The value indicates the initial start value for a sequence with no other entities other than this existing one

    Set from EntitySequenceAttribute

    Declaration
    public short? SequenceStart { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int16>

    TrackChanges

    Indicates the system will track the otiginal value of this property before it is changed

    This only happens for properties marked with DBTrackChangesAttribute and when working from a service or directly connected to the database.

    Declaration
    public bool TrackChanges { get; set; }
    Property Value
    Type Description
    System.Boolean

    UseForReplicatingDescriptorType

    Indicates this property should be the one used to determine the type of entity when replicating this entity for every other entity in the system.

    Can be set from UseForReplicatingDescriptorType

    i.e. The permissions table is created for every entity in the system
    Declaration
    public bool UseForReplicatingDescriptorType { get; set; }
    Property Value
    Type Description
    System.Boolean

    UserFriendlyName

    Holds the user friendly name of the property.

    Declaration
    public string UserFriendlyName { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    Clone()

    Declaration
    public ColumnDescriptor Clone()
    Returns
    Type Description
    ColumnDescriptor

    CopyFromSource(ColumnDescriptor)

    Declaration
    public void CopyFromSource(ColumnDescriptor source)
    Parameters
    Type Name Description
    ColumnDescriptor source

    CopyFromSource(Object)

    Declaration
    public void CopyFromSource(object source)
    Parameters
    Type Name Description
    System.Object source

    Equals(ColumnDescriptor)

    Declaration
    public bool Equals(ColumnDescriptor other)
    Parameters
    Type Name Description
    ColumnDescriptor other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    Indicates this entity is equal to the other if both property names match

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The item to compare equality to this entity with

    Returns
    Type Description
    System.Boolean

    True if both property names match

    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    Explicit Interface Implementations

    ICloneable.Clone()

    Declaration
    object ICloneable.Clone()
    Returns
    Type Description
    System.Object

    Implements

    System.IEquatable<T>
    ICloneable<T>
    ICloneable

    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 © LemonEdge Technology. All rights reserved.