Show / Hide Table of Contents

Interface IPersistableModel<T>

Allows an object to control its own writing and reading. The format is determined by the implementer.

IJsonModel<T>
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.NullableContext(1)]
public interface IPersistableModel<out T>
Type Parameters
T

The type the model can be converted into.

Methods

Create(BinaryData, ModelReaderWriterOptions)

Converts the provided System.BinaryData into a model.

Declaration
public T Create (BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.BinaryData data

The System.BinaryData to parse.

ModelReaderWriterOptions options

The ModelReaderWriterOptions to use.

Returns
T

A T representation of the data.

Exceptions
System.FormatException

If the model does not support the requested Format.

GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

Declaration
public string GetFormatFromOptions (System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
ModelReaderWriterOptions options

The ModelReaderWriterOptions to consider when serializing and deserializing the model.

Returns
System.String

The format that the model uses when communicating with the service.

Write(ModelReaderWriterOptions)

Writes the model into a System.BinaryData.

Declaration
public BinaryData Write (System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
ModelReaderWriterOptions options

The ModelReaderWriterOptions to use.

Returns
System.BinaryData

A binary representation of the written model.

Exceptions
System.FormatException

If the model does not support the requested Format.

Back to top Azure SDK for .NET