Show / Hide Table of Contents

Interface IJsonModel<T>

Allows an object to control its own JSON writing and reading.

Inherited Members
IPersistableModel<T>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<T>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<T>.Write(ModelReaderWriterOptions)
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.NullableContext(1)]
public interface IJsonModel<out T> : System.ClientModel.Primitives.IPersistableModel<out T>
Type Parameters
T

The type the model can be converted into.

Methods

Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

Declaration
public T Create (ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.Text.Json.Utf8JsonReader reader

The System.Text.Json.Utf8JsonReader to read.

ModelReaderWriterOptions options

The ModelReaderWriterOptions to use.

Returns
T

A T representation of the JSON value.

Exceptions
System.FormatException

If the model does not support the requested Format.

Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided System.Text.Json.Utf8JsonWriter.

Declaration
public void Write (System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.Text.Json.Utf8JsonWriter writer

The System.Text.Json.Utf8JsonWriter to write into.

ModelReaderWriterOptions options

The ModelReaderWriterOptions to use.

Exceptions
System.FormatException

If the model does not support the requested Format.

Back to top Azure SDK for .NET