Search Results for

    Show / Hide Table of Contents

    Class Relation

    Represents a relation between two dimensions.

    Inheritance
    System.Object
    DynamicObject
    NamedDynamicObject
    ModelElement
    RelationBase
    Relation
    Implements
    System.Dynamic.IDynamicMetaObjectProvider
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.IDataErrorInfo
    INullable
    Inherited Members
    RelationBase.Attach(ModelElement)
    RelationBase.RemovePermissions()
    RelationBase.Permissions
    RelationBase.DataType
    ModelElement.IsValidIdentifier(String)
    ModelElement.Detach()
    ModelElement.SetOwnershipPrefix(String)
    ModelElement.UpdateChildren(NotifyCollectionChangedEventArgs)
    ModelElement.SetPersistBehavior(PersistBehavior)
    ModelElement.SetName(String)
    ModelElement.SetOwnership(Ownership)
    ModelElement.ElementGuid
    ModelElement.Name
    ModelElement.Parent
    ModelElement.Children
    ModelElement.PersistBehavior
    ModelElement.IsFullPersistBehavior
    ModelElement.IsNonePersistBehavior
    ModelElement.IsSystemElement
    ModelElement.IsApplicationSpecificElement
    ModelElement.IsUserElement
    ModelElement.IsSystemOrApplicationSpecificElement
    ModelElement.InvariantFriendlyName
    ModelElement.CreationVersion
    ModelElement.LastUpdateVersion
    ModelElement.Error
    ModelElement.ErrorSummary
    ModelElement.IsValid
    ModelElement.Ownership
    ModelElement.OwnershipPrefix
    ModelElement.NonPrefixedName
    NamedDynamicObject.OnPropertyChanged(String)
    NamedDynamicObject.PropertyChanged
    DynamicObject.GetMember(String)
    DynamicObject.SetMember(String, Object)
    DynamicObject.GetMetaObject(Expression)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: TimeCockpit.Data.DataModel
    Assembly: TimeCockpit.Data.dll
    Syntax
    public class Relation : RelationBase, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo, INullable

    Constructors

    Relation()

    Initializes a new instance of the Relation class

    Declaration
    public Relation()

    Relation(IEnumerable<KeyValuePair<Object, Object>>)

    Initializes a new instance of the Relation class.

    Declaration
    public Relation(IEnumerable<KeyValuePair<object, object>> properties)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>> properties

    Collection of properties.

    Remarks

    You can use this constructor to initialize a new instance of the ModelRelation class by specifying its properties in a list of key/value pairs. This is especially useful for dynamic languages like python.

    Relation(Relation)

    Initializes a new instance of the Relation class

    Declaration
    public Relation(Relation element)
    Parameters
    Type Name Description
    Relation element

    The relation to copy.

    Remarks

    This copy constructor creates copies of all value-typed properties. StorageColumns and Permissions from element are just added to the corresponding collections of the new Relation. No copying is performed.

    Properties

    BackReferenceInvariantFriendlyName

    Gets or sets the name of the back reference invariant friendly.

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

    The name of the back reference invariant friendly.

    BackReferenceName

    Gets or sets the name of the back reference for the relation.

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

    In a 1:n relation the relation's name can be used to identify the related object on the left side of the relation (e.g. given a 1:n relationship CustomerRelation between customers and project its name can be used on a Project entity to identify the related Customer entity: Project.CustomerRelation).

    The back reference name can be used to identify the list of entities on the right side of the relation (e.g. Customer.Projects can be used to identify all projects for a customer entity if Projects is the BackReferenceName of the relation).

    You have to set the back reference name explicitly. If you do not set it you cannot use functions depending on back reference names (e.g. subqueries).

    DefaultValueExpression

    Gets or sets the expression that determines the default value of the property

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

    DefaultValueFunction

    Gets the default value of a property by evaluate an expression

    Declaration
    public Func<EntityObject, Environment, IEnumerable<QueryParameter>, object> DefaultValueFunction { get; }
    Property Value
    Type Description
    System.Func<EntityObject, Environment, System.Collections.Generic.IEnumerable<QueryParameter>, System.Object>

    EvaluateDefaultValue

    Gets a value indicating whether to evaluate the default value.

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

    true if the default value is to be evaluate; otherwise, false.

    EvaluateDefaultValueExpression

    Gets or sets the default value evaluation time expression.

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

    The default value evaluation time expression.

    EvaluateDefaultValueFunction

    Gets a value determining whether a default value should be evaluated

    Declaration
    public Func<EntityObject, bool> EvaluateDefaultValueFunction { get; }
    Property Value
    Type Description
    System.Func<EntityObject, System.Boolean>

    HasDefaultValueExpression

    Gets a value indicating whether a property has a default value expression or not

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

    IsNullable

    Gets or sets a value indicating whether the Relation instance should be nullable or not.

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

    true if this instance is nullable; otherwise, false.

    Overrides
    RelationBase.IsNullable

    OnDeleteAction

    Gets or sets the on delete action.

    Declaration
    public OnDeleteAction OnDeleteAction { get; set; }
    Property Value
    Type Description
    OnDeleteAction

    StorageColumns

    Gets a list of storage columns.

    Declaration
    public virtual Collection<StorageColumn> StorageColumns { get; }
    Property Value
    Type Description
    System.Collections.ObjectModel.Collection<StorageColumn>

    List of storage columns.

    Target

    Gets or sets the target of the relation.

    Declaration
    public override ModelEntityBase Target { get; set; }
    Property Value
    Type Description
    ModelEntityBase
    Overrides
    RelationBase.Target

    Methods

    Accept(ModelElementVisitor)

    Accepts a visitor. Dispatches the correct call in the visitor.

    Declaration
    public override void Accept(ModelElementVisitor visitor)
    Parameters
    Type Name Description
    ModelElementVisitor visitor

    the visitor to accept.

    Overrides
    ModelElement.Accept(ModelElementVisitor)

    InitializeObject()

    Initializes the Relation object setting fields of the object to their default values.

    Declaration
    protected override void InitializeObject()
    Overrides
    RelationBase.InitializeObject()

    IsValueAffectedByPropertyChange(EntityObject, String)

    Determines whether the value for this property is changed if the memberName is changed.

    Declaration
    public bool IsValueAffectedByPropertyChange(EntityObject entityObject, string memberName)
    Parameters
    Type Name Description
    EntityObject entityObject

    The entityobject holding the property that changed.

    System.String memberName

    The name of the member (relation or property) that changed.

    Returns
    Type Description
    System.Boolean

    Returns a value indicating whether the value of a property is affected by a changed property name.

    OnDeserializing(StreamingContext)

    Called whenever deserialization of the model element is happening

    Declaration
    [OnDeserializing]
    public void OnDeserializing(StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.StreamingContext context

    Stream context used for deserialization.

    Remarks

    This method is necessary to instantiate an instance of the current ModelElement after deserialization. As for the System.Runtime.Serialization.DataContractSerializer, constructors are not always called and fields not correctly initialized. While deserializing, this method is called and the fields of the ModelElement are correctly initialized.

    ShallowCopy()

    Performs a shallow copy of the current Relation.

    Declaration
    public override RelationBase ShallowCopy()
    Returns
    Type Description
    RelationBase

    A shallow copy of the current Relation.

    Overrides
    RelationBase.ShallowCopy()
    Remarks

    The MemberwiseClone method creates a shallow copy by creating a new object, and then copying the nonstatic fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If a field is a reference type, the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object.

    ShallowCopy(String, PersistBehavior, Ownership, Boolean, Boolean)

    Performs a shallow copy of the current Relation.

    Declaration
    public override RelationBase ShallowCopy(string name, PersistBehavior persistBehavior, Ownership ownership, bool ignorePermissions = false, bool ignoreDefaultValues = false)
    Parameters
    Type Name Description
    System.String name

    The name of the property to clone.

    PersistBehavior persistBehavior

    The PersistBehavior the cloned relation should have.

    Ownership ownership

    The Ownership the cloned relation should have.

    System.Boolean ignorePermissions

    if set to true [ignore permissions].

    System.Boolean ignoreDefaultValues

    if set to true [ignore default values].

    Returns
    Type Description
    RelationBase

    A shallow copy of the current Relation.

    Overrides
    RelationBase.ShallowCopy(String, PersistBehavior, Ownership, Boolean, Boolean)
    Remarks

    The MemberwiseClone method creates a shallow copy by creating a new object, and then copying the nonstatic fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If a field is a reference type, the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object.

    Validate(ref IList<PropertyValidationMessage>, Boolean)

    Validates a ModelElement according to certain rules.

    Declaration
    protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<PropertyValidationMessage> messages

    An list of strings that stores that picks up the validation errors of a model element.

    System.Boolean validateRecursively

    Indicates wheter to validate only the current model element or all its children (recursively) as well.

    Overrides
    ModelElement.Validate(ref IList<PropertyValidationMessage>, Boolean)
    Remarks

    The rules the ModelElement is validated against are dependent on the type of ModelElement that is validated. This method can be overridden to provide custom validation behavior for subclasses of ModelElement

    When Validate(ref IList<PropertyValidationMessage>, Boolean) is called on a modelelement, the Validate(ref IList<PropertyValidationMessage>, Boolean) method of all children attatched to the modelelemnt are validated recursivly.

    In This Article
    Back to top Copyright © 2020 software architects gmbh