Table of Contents

Class GraphSerializationExtensions

Namespace
FlowGraph.Core.Serialization
Assembly
FlowGraph.Core.dll

Extension methods for graph serialization.

public static class GraphSerializationExtensions
Inheritance
GraphSerializationExtensions
Inherited Members

Methods

Clone(Graph)

Creates a deep copy of the graph via serialization.

public static Graph Clone(this Graph graph)

Parameters

graph Graph

Returns

Graph

LoadFromFile(string)

Loads a graph from a JSON file synchronously.

public static Graph? LoadFromFile(string filePath)

Parameters

filePath string

Returns

Graph

LoadFromFileAsync(string)

Loads a graph from a JSON file.

public static Task<Graph?> LoadFromFileAsync(string filePath)

Parameters

filePath string

Returns

Task<Graph>

LoadFromJson(string)

Loads a graph from JSON string.

public static Graph? LoadFromJson(string json)

Parameters

json string

Returns

Graph

Save(Graph, string)

Saves the graph to a JSON file synchronously.

public static void Save(this Graph graph, string filePath)

Parameters

graph Graph
filePath string

SaveAsync(Graph, string)

Saves the graph to a JSON file.

public static Task SaveAsync(this Graph graph, string filePath)

Parameters

graph Graph
filePath string

Returns

Task

ToJson(Graph, bool)

Serializes the graph to JSON.

public static string ToJson(this Graph graph, bool indented = true)

Parameters

graph Graph
indented bool

Returns

string