JsonExtensions Class

Provides extension methods for serializing Numerics.NET types to JSON using JsonSerializer and for configuring JsonSerializerOptions to support Numerics.NET.

Definition

Namespace: Numerics.NET.Data.Json
Assembly: Numerics.NET.Data.Json (in Numerics.NET.Data.Json.dll) Version: 4.1.0
C#
public static class JsonExtensions
Inheritance
Object  →  JsonExtensions

Remarks

This class includes methods for serializing Numerics.NET types to JSON strings or streams, as well as a method to configure JsonSerializerOptions to register Numerics.NET-specific converters and metadata. The serialization methods ensure that Numerics.NET types are properly handled by the JSON serializer, including support for both reflection-based converters on legacy frameworks and source-generated contexts on modern frameworks.

Methods

AddNumericsJson Registers Numerics.NET JSON converters and metadata on the given options instance.
ToJson<T>(Index<T>, JsonSerializerOptions) Serializes the Index<T> to a JSON string using the specified options.
ToJson<T>(Matrix<T>, JsonSerializerOptions) Serializes the Matrix<T> to a JSON string using the specified options.
ToJson<T>(Vector<T>, JsonSerializerOptions) Serializes the Vector<T> to a JSON string using the specified options.
ToJson<T>(Index<T>, Stream, JsonSerializerOptions) Serializes the Index<T> to a stream as JSON using the specified options.
ToJson<T>(Matrix<T>, Stream, JsonSerializerOptions) Serializes the Matrix<T> to a stream as JSON using the specified options.
ToJson<T>(Vector<T>, Stream, JsonSerializerOptions) Serializes the Vector<T> to a stream as JSON using the specified options.
ToJson<R, C>(DataFrame<R, C>, JsonSerializerOptions) Serializes the DataFrame<R, C> to a JSON string using the specified options.
ToJson<R, C>(DataFrame<R, C>, Stream, JsonSerializerOptions) Serializes the DataFrame<R, C> to a stream as JSON using the specified options.

See Also