/// <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; }
/// <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); } }