ModelReaderWriter.Write Method

Definition

Overloads

Write(Object, ModelReaderWriterOptions)

Converts the value of a model into a BinaryData.

Write<T>(T, ModelReaderWriterOptions)

Converts the value of a model into a BinaryData.

Write(Object, ModelReaderWriterOptions)

Source:
ModelReaderWriter.cs
Source:
ModelReaderWriter.cs

Converts the value of a model into a BinaryData.

public static BinaryData Write (object model, System.ClientModel.Primitives.ModelReaderWriterOptions? options = default);

Parameters

model
Object

The model to convert.

Returns

A BinaryData representation of the model in the Format specified by the options.

Exceptions

Throws if model does not implement IPersistableModel<T>.

If the model does not support the requested Format.

If model is null.

Applies to

Write<T>(T, ModelReaderWriterOptions)

Source:
ModelReaderWriter.cs
Source:
ModelReaderWriter.cs

Converts the value of a model into a BinaryData.

public static BinaryData Write<T> (T model, System.ClientModel.Primitives.ModelReaderWriterOptions? options = default) where T : System.ClientModel.Primitives.IPersistableModel<T>;

Type Parameters

T

The type of the value to write.

Parameters

model
T

The model to convert.

Returns

A BinaryData representation of the model in the Format specified by the options.

Exceptions

If the model does not support the requested Format.

If model is null.

Applies to