Skip to main content

DmlValueCoercer

  • Namespace: PPDS.Dataverse.Query
  • Assembly: PPDS.Dataverse
  • Kind: Class

Summary

Coerces raw CLR values from SQL DML into Dataverse SDK-typed values (Microsoft.Xrm.Sdk.EntityReference for lookups, Microsoft.Xrm.Sdk.OptionSetValue for choices, Microsoft.Xrm.Sdk.Money for currency, etc.) using attribute metadata.

Members

Methods

Coerce

object Coerce(object value, AttributeMetadataDto attribute)

Coerces value to the Dataverse SDK type implied by attribute. Returns the input unchanged when coercion is not possible (null input, null metadata, unsupported type).

  • Param value: The raw CLR value from a compiled SQL expression.

  • Param attribute: Target attribute metadata, or null if unknown.

  • Returns: The coerced value, or value unchanged.