Compartir a través de


ModelReaderWriter.Read Method

Definition

Overloads

Read(BinaryData, Type, ModelReaderWriterOptions)

Converts the BinaryData into a returnType.

Read<T>(BinaryData, ModelReaderWriterOptions)

Converts the BinaryData into a T.

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);
static member Read : BinaryData * Type * System.ClientModel.Primitives.ModelReaderWriterOptions -> obj
Public Shared Function Read (data As BinaryData, returnType As Type, Optional options As ModelReaderWriterOptions = Nothing) As Object

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>;
static member Read : BinaryData * System.ClientModel.Primitives.ModelReaderWriterOptions -> 'T (requires 'T :> System.ClientModel.Primitives.IPersistableModel<'T>)
Public Shared Function Read(Of T As IPersistableModel(Of T)) (data As BinaryData, Optional options As ModelReaderWriterOptions = Nothing) As 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