ModelReaderWriter.Read Method

Definition

Overloads

Read(BinaryData, Type, ModelReaderWriterOptions)

Source:
ModelReaderWriter.cs
Source:
ModelReaderWriter.cs

Converts the BinaryData into a returnType.

public static object? Read (BinaryData data, Type returnType, System.ClientModel.Primitives.ModelReaderWriterOptions? options = default);

Parameters

data
BinaryData

The BinaryData to convert.

returnType
Type

The type of the objec to convert and return.

Returns

A returnType representation of the BinaryData.

Exceptions

Throws if returnType does not have a public or internal parameterless constructor.

If the model does not support the requested Format.

If data or returnType are null.

If returnType does not have a public or non public empty constructor.

Applies to

Read<T>(BinaryData, ModelReaderWriterOptions)

Source:
ModelReaderWriter.cs
Source:
ModelReaderWriter.cs

Converts the BinaryData into a T.

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

Type Parameters

T

Parameters

data
BinaryData

The BinaryData to convert.

Returns

T

A T representation of the BinaryData.

Exceptions

Throws if T does not have a public or internal parameterless constructor.

If the model does not support the requested Format.

If data is null.

If T does not have a public or non public empty constructor.

Applies to