你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ModelReaderWriter.Read Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Read(BinaryData, Type, ModelReaderWriterOptions) |
Converts the BinaryData into a |
Read<T>(BinaryData, ModelReaderWriterOptions) |
Converts the BinaryData into a |
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.
- options
- ModelReaderWriterOptions
The ModelReaderWriterOptions to use.
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.
- options
- ModelReaderWriterOptions
The ModelReaderWriterOptions to use.
Returns
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.