你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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);
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 object 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(BinaryData, Type, ModelReaderWriterOptions, ModelReaderWriterContext)

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

Parameters

data
BinaryData

The BinaryData to convert.

returnType
Type

The type of the object 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

Read<T>(BinaryData, ModelReaderWriterOptions, ModelReaderWriterContext)

Source:
ModelReaderWriter.cs
Source:
ModelReaderWriter.cs

Converts the BinaryData into a T.

public static T? Read<T>(BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options, System.ClientModel.Primitives.ModelReaderWriterContext context);
static member Read : BinaryData * System.ClientModel.Primitives.ModelReaderWriterOptions * System.ClientModel.Primitives.ModelReaderWriterContext -> 'T
Public Shared Function Read(Of T) (data As BinaryData, options As ModelReaderWriterOptions, context As ModelReaderWriterContext) 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