本文整理汇总了C#中Microsoft.OData.Core.ODataProperty.HasMaterializedValue方法的典型用法代码示例。如果您正苦于以下问题:C# ODataProperty.HasMaterializedValue方法的具体用法?C# ODataProperty.HasMaterializedValue怎么用?C# ODataProperty.HasMaterializedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Core.ODataProperty
的用法示例。
在下文中一共展示了ODataProperty.HasMaterializedValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MaterializeEnumTypeProperty
/// <summary>
/// Materializes the enum data value.
/// </summary>
/// <param name="valueType">Type of the collection item.</param>
/// <param name="property">The ODataProperty.</param>
/// <returns>Materialized enum data CLR value.</returns>
public object MaterializeEnumTypeProperty(Type valueType, ODataProperty property)
{
object materializedValue = null;
ODataEnumValue value = property.Value as ODataEnumValue;
this.MaterializeODataEnumValue(valueType, value.TypeName, value.Value, () => "TODO: Is this reachable?", out materializedValue);
if (!property.HasMaterializedValue())
{
property.SetMaterializedValue(materializedValue);
}
return materializedValue;
}
示例2: MaterializePrimitiveDataValue
/// <summary>Materializes a primitive value. No op for non-primitive values.</summary>
/// <param name="type">Type of value to set.</param>
/// <param name="property">Property holding value.</param>
internal void MaterializePrimitiveDataValue(Type type, ODataProperty property)
{
Debug.Assert(type != null, "type != null");
Debug.Assert(property != null, "atomProperty != null");
if (!property.HasMaterializedValue())
{
object value = property.Value;
object materializedValue = this.PrimitivePropertyConverter.ConvertPrimitiveValue(value, type);
property.SetMaterializedValue(materializedValue);
}
}