共用方式為


EdmToClrConverter.AsClrValue 方法

定義

多載

AsClrValue(IEdmValue, Type)

edmValue轉換為指定型別的 CLR 值。 支援的值為 clrType :CLR 基本類型,例如 StringInt32 、CLR 列舉類型、 IEnumerable<T>ICollection<T>IList<T> 、CLR 類別,具有預設建構函式,以及具有下列圖形之 setters 和集合屬性的公用屬性: IEnumerable<T> EnumerableProperty { get; set; }, ICollection<T> CollectionProperty { get; set; }, IList<T> ListProperty { get; }, ICollection<T> CollectionProperty { get { return this.nonNullCollection; } }, IList<T> ListProperty { get { return this.nonNullList; } }。

AsClrValue<T>(IEdmValue)

edmValue轉換為指定型別的 CLR 值。 支援的值為 T :CLR 基本類型,例如 StringInt32 、CLR 列舉類型、 IEnumerable<T>ICollection<T>IList<T> 、CLR 類別,具有預設建構函式,以及具有下列圖形之 setters 和集合屬性的公用屬性: IEnumerable<T> EnumerableProperty { get; set; }, ICollection<T> CollectionProperty { get; set; }, IList<T> ListProperty { get; }, ICollection<T> CollectionProperty { get { return this.nonNullCollection; } }, IList<T> ListProperty { get { return this.nonNullList; } }。

AsClrValue(IEdmValue, Type)

edmValue轉換為指定型別的 CLR 值。 支援的值為 clrType :CLR 基本類型,例如 StringInt32 、CLR 列舉類型、 IEnumerable<T>ICollection<T>IList<T> 、CLR 類別,具有預設建構函式,以及具有下列圖形之 setters 和集合屬性的公用屬性: IEnumerable<T> EnumerableProperty { get; set; }, ICollection<T> CollectionProperty { get; set; }, IList<T> ListProperty { get; }, ICollection<T> CollectionProperty { get { return this.nonNullCollection; } }, IList<T> ListProperty { get { return this.nonNullList; } }。

public object AsClrValue (Microsoft.OData.Edm.Vocabularies.IEdmValue edmValue, Type clrType);
member this.AsClrValue : Microsoft.OData.Edm.Vocabularies.IEdmValue * Type -> obj
Public Function AsClrValue (edmValue As IEdmValue, clrType As Type) As Object

參數

edmValue
IEdmValue

要轉換的 EDM 值。

clrType
Type

CLR 型別。

傳回

edmValue 轉換的 CLR 值。

備註

此方法執行實值型別的 Boxing 和 Unboxing。 使用實數值型別特定方法,例如 Microsoft.OData.Edm.Vocabularies.EdmToClrConverter.AsClrString(Microsoft.OData.Edm.Vocabularies.IEdmValue) 避免 Boxing 和 unboxing。

適用於

AsClrValue<T>(IEdmValue)

edmValue轉換為指定型別的 CLR 值。 支援的值為 T :CLR 基本類型,例如 StringInt32 、CLR 列舉類型、 IEnumerable<T>ICollection<T>IList<T> 、CLR 類別,具有預設建構函式,以及具有下列圖形之 setters 和集合屬性的公用屬性: IEnumerable<T> EnumerableProperty { get; set; }, ICollection<T> CollectionProperty { get; set; }, IList<T> ListProperty { get; }, ICollection<T> CollectionProperty { get { return this.nonNullCollection; } }, IList<T> ListProperty { get { return this.nonNullList; } }。

public T AsClrValue<T> (Microsoft.OData.Edm.Vocabularies.IEdmValue edmValue);
member this.AsClrValue : Microsoft.OData.Edm.Vocabularies.IEdmValue -> 'T
Public Function AsClrValue(Of T) (edmValue As IEdmValue) As T

類型參數

T

CLR 型別。

參數

edmValue
IEdmValue

要轉換的 EDM 值。

傳回

T

edmValue 轉換的 CLR 值。

備註

此方法執行實值型別的 Boxing 和 Unboxing。 使用實數值型別特定方法,例如 Microsoft.OData.Edm.Vocabularies.EdmToClrConverter.AsClrString(Microsoft.OData.Edm.Vocabularies.IEdmValue) 避免 Boxing 和 unboxing。

適用於