ClassRelation Class

A relation between two elements of a class diagram, such as an inheritance or a composition.

public sealed class ClassRelation

Constructors

NameDescription
ClassRelation(ClassDiagramElement, ClassDiagramElement)Initializes a new instance of the ClassRelation class.

ClassRelation(ClassDiagramElement, ClassDiagramElement)

ClassRelation.cs

Initializes a new instance of the ClassRelation class.

public ClassRelation(ClassDiagramElement from, ClassDiagramElement to)

Parameters

from ClassDiagramElement
The first element, written on the left in Mermaid.
to ClassDiagramElement
The second element, written on the right in Mermaid.

Properties

NameDescription
FromGets the first element.
FromCardinalityGets or sets the multiplicity at ClassRelation.From, such as 1 or 0..*, or null for none.
FromEndGets or sets the decoration of the end at ClassRelation.From: A <|-- B has an ClassRelationEnd.Inheritance at A.
IsDashedGets or sets a value that indicates whether the line is dashed: a dependency or a realization (Mermaid ..).
LabelGets or sets the text in the middle of the relation, or null for none.
ToGets the second element.
ToCardinalityGets or sets the multiplicity at ClassRelation.To, or null for none.
ToEndGets or sets the decoration of the end at ClassRelation.To.

Gets the first element.

public ClassDiagramElement From { get; }

Property value

ClassDiagramElement

FromCardinality

ClassRelation.cs

Gets or sets the multiplicity at ClassRelation.From, such as 1 or 0..*, or null for none.

public string? FromCardinality { get; set; }

Property value

string?

Gets or sets the decoration of the end at ClassRelation.From: A <|-- B has an ClassRelationEnd.Inheritance at A.

public ClassRelationEnd FromEnd { get; set; }

Property value

ClassRelationEnd

Gets or sets a value that indicates whether the line is dashed: a dependency or a realization (Mermaid ..).

public bool IsDashed { get; set; }

Property value

bool

Gets or sets the text in the middle of the relation, or null for none.

public DiagramText? Label { get; set; }

Property value

DiagramText?

Gets the second element.

public ClassDiagramElement To { get; }

Property value

ClassDiagramElement

ToCardinality

ClassRelation.cs

Gets or sets the multiplicity at ClassRelation.To, or null for none.

public string? ToCardinality { get; set; }

Property value

string?

Gets or sets the decoration of the end at ClassRelation.To.

public ClassRelationEnd ToEnd { get; set; }

Property value

ClassRelationEnd