# MermaidEntityRelationshipDocument

Describes a parsed Mermaid entity relationship diagram.

 Class  

`ChartForgeX.Mermaid`

**Namespace**

`ChartForgeX.Mermaid`

**Assembly**

`ChartForgeX.Mermaid`

**Source**

[MermaidEntityRelationshipDocument.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L11)

**Base**

`MermaidDocument`

**Modifiers**

sealed

Describes a parsed Mermaid entity relationship diagram.

## Inheritance

- [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)
- MermaidEntityRelationshipDocument

## Usage

 Explore 9 API references to this type 

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [MermaidParser.ParseEntityRelationship](/api/chartforgex-mermaid-mermaidparser/#method-parseentityrelationship-string)

### Accepted by parameters 8

- Extension method [MermaidEntityRelationshipDocument.ToPng](/api/chartforgex-mermaid-mermaidentityrelationshipdocument/#extension-topng-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidEntityRelationshipDocument.ToSvg](/api/chartforgex-mermaid-mermaidentityrelationshipdocument/#extension-tosvg-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidEntityRelationshipDocument.ToTopologyChart](/api/chartforgex-mermaid-mermaidentityrelationshipdocument/#extension-totopologychart-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidEntityRelationshipDocument.ToVisualArtifact](/api/chartforgex-mermaid-mermaidentityrelationshipdocument/#extension-tovisualartifact-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToPng](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-topng-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToSvg](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-tosvg-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToTopologyChart](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-totopologychart-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToVisualArtifact](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-tovisualartifact-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`

 Filter members   

    Show inherited   

 

## Constructors

 `public MermaidEntityRelationshipDocument()` [#](#constructor-ctor) 

[MermaidEntityRelationshipDocument.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L11)

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public string? Direction { get; set; }` [#](#property-direction) 

[MermaidEntityRelationshipDocument.cs:14](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L14)

Gets or sets the authored whole-diagram direction.

 `public List<MermaidEntityNode> Entities { get; }` [#](#property-entities) 

[MermaidEntityRelationshipDocument.cs:17](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L17)

Gets entities in source order.

 `public List<MermaidEntityGroup> Groups { get; }` [#](#property-groups) 

[MermaidEntityRelationshipDocument.cs:20](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L20)

Gets source-authored groups in declaration order.

 `public List<MermaidEntityRelationship> Relationships { get; }` [#](#property-relationships) 

[MermaidEntityRelationshipDocument.cs:23](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L23)

Gets relationships in source order.

 `public List<MermaidStyleDefinition> ClassDefinitions { get; }` [#](#property-classdefinitions) 

[MermaidEntityRelationshipDocument.cs:26](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L26)

Gets named style definitions in source order.

 `public List<MermaidRawStatement> StyleStatements { get; }` [#](#property-stylestatements) 

[MermaidEntityRelationshipDocument.cs:29](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidEntityRelationshipDocument.cs#L29)

Gets style declarations and assignments in source order.

## Inherited Properties

 `public MermaidDiagramKind Kind { get; set; }` [#](#property-kind) 

[MermaidDocument.cs:91](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L91)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public bool IsDiagnosticOnly { get; }` [#](#property-isdiagnosticonly) 

[MermaidDocument.cs:94](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L94)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string SourceText { get; set; }` [#](#property-sourcetext) 

[MermaidDocument.cs:97](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L97)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public MermaidSourceSpan HeaderSpan { get; set; }` [#](#property-headerspan) 

[MermaidDocument.cs:100](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L100)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string Header { get; set; }` [#](#property-header) 

[MermaidDocument.cs:103](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L103)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string? FrontMatter { get; set; }` [#](#property-frontmatter) 

[MermaidDocument.cs:106](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L106)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public VisualAccessibility Accessibility { get; }` [#](#property-accessibility) 

[MermaidDocument.cs:109](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L109)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string? Theme { get; set; }` [#](#property-theme) 

[MermaidDocument.cs:112](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L112)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public MermaidSourceConfiguration Configuration { get; internal set; }` [#](#property-configuration) 

[MermaidDocument.cs:115](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L115)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public List<MermaidDirective> Directives { get; }` [#](#property-directives) 

[MermaidDocument.cs:118](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L118)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public List<MermaidRawStatement> RawStatements { get; }` [#](#property-rawstatements) 

[MermaidDocument.cs:121](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L121)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

## Extension Methods

 `public static byte[] ToPng(MermaidEntityRelationshipDocument document, MermaidTopologyRenderOptions? options = null)` [#](#extension-topng-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidTopologyRendering.cs:160](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L160)

Renders a Mermaid ER diagram to PNG.

Parameters

**document ChartForgeX.Mermaid.MermaidEntityRelationshipDocument required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `byte[]` 

 `public static string ToSvg(MermaidEntityRelationshipDocument document, MermaidTopologyRenderOptions? options = null)` [#](#extension-tosvg-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidTopologyRendering.cs:144](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L144)

Renders a Mermaid ER diagram to SVG.

Parameters

**document ChartForgeX.Mermaid.MermaidEntityRelationshipDocument required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `string` 

 `public static TopologyChart ToTopologyChart(MermaidEntityRelationshipDocument document, MermaidTopologyRenderOptions? options = null)` [#](#extension-totopologychart-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidTopologyRendering.cs:66](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L66)

Converts a Mermaid ER diagram to a topology chart.

Parameters

**document ChartForgeX.Mermaid.MermaidEntityRelationshipDocument required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `TopologyChart` 

 `public static VisualArtifact ToVisualArtifact(MermaidEntityRelationshipDocument document, MermaidTopologyRenderOptions? options = null)` [#](#extension-tovisualartifact-chartforgex-mermaid-mermaidentityrelationshipdocument-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidTopologyRendering.cs:128](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L128)

Wraps a Mermaid ER diagram in a visual artifact envelope.

Parameters

**document ChartForgeX.Mermaid.MermaidEntityRelationshipDocument required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `VisualArtifact` 

<!-- PowerForge markdown artifact sha256:BBE2B5AE8D41679F947491D3E111FF21E500ED5ABCC8627AAF4286ADE8159DD0 -->
