Table of Contents

Class Relationship

Namespace
C4.Net
Assembly
C4.Net.Core.dll

A relationship between two elements.

[DataContract]
public sealed class Relationship : ModelItem, IEquatable<Relationship>
Inheritance
Relationship
Implements
Inherited Members

Properties

Description

A short description of this relationship.

[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; }

Property Value

string

Destination

The destination element of the relationship.

public Element Destination { get; set; }

Property Value

Element

DestinationId

The ID of the destination element.

[DataMember(Name = "destinationId", EmitDefaultValue = false)]
public string DestinationId { get; set; }

Property Value

string

InteractionStyle

The interaction style (synchronous or asynchronous).

[DataMember(Name = "interactionStyle", EmitDefaultValue = false)]
public InteractionStyle? InteractionStyle { get; set; }

Property Value

InteractionStyle?

LinkedRelationshipId

The identifier of the static relationship that this replicated deployment relationship was derived from.

[DataMember(Name = "linkedRelationshipId", EmitDefaultValue = false)]
public string LinkedRelationshipId { get; }

Property Value

string

Source

The source element of the relationship.

public Element Source { get; set; }

Property Value

Element

SourceId

The ID of the source element.

[DataMember(Name = "sourceId", EmitDefaultValue = false)]
public string SourceId { get; set; }

Property Value

string

Technology

The technology associated with this relationship (e.g. HTTPS, JDBC, etc).

[DataMember(Name = "technology", EmitDefaultValue = false)]
public string Technology { get; }

Property Value

string

Url

The URL where more information about this relationship can be found.

[DataMember(Name = "url", EmitDefaultValue = false)]
public string Url { get; set; }

Property Value

string

Methods

Equals(Relationship)

Compares this relationship with another relationship by source, destination, and description.

public bool Equals(Relationship relationship)

Parameters

relationship Relationship

The relationship to compare with.

Returns

bool

true when both relationships connect the same elements with the same description; otherwise, false.

Equals(object)

Compares this relationship with another object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with.

Returns

bool

true when obj is a matching Relationship; otherwise, false.

GetHashCode()

Returns a hash code derived from the source, destination, and description.

public override int GetHashCode()

Returns

int

A hash code for the current relationship.

GetRequiredTags()

Returns the built-in tags that apply to this relationship.

public override List<string> GetRequiredTags()

Returns

List<string>

A list containing the relationship tag and, for non-linked relationships, the appropriate synchronous or asynchronous tag.

ToJson()

Returns the JSON string presentation of the object

public string ToJson()

Returns

string

JSON string presentation of the object

ToString()

Returns a readable representation of the relationship.

public override string ToString()

Returns

string

A string containing the source, description, and destination.