ValueExpressionParserTUpdateInstance(IEnumerablePropertyInfo, TypeRegistry) Method

Generates a delegate that will update an instance of type T applying any specified UpdateValueExpressionAttribute instances that are declared on the type T properties. Target T instance is accepted as the parameter to the returned delegate ActionT.

Definition

Namespace: Gemstone.Expressions.Model
Assembly: Gemstone.Expressions (in Gemstone.Expressions.dll) Version: 1.0.166 -- Release Build+b9d6a8ace5a2e92842f42ad9e3bd94e5b5e57d9d
public static Action<T> UpdateInstance(
	IEnumerable<PropertyInfo>? properties = null,
	TypeRegistry? typeRegistry = null
)

Parameters

properties  IEnumerablePropertyInfo  (Optional)
Specific properties to target, or null to target all properties.
typeRegistry  TypeRegistry  (Optional)
Type registry to use when parsing UpdateValueExpressionAttribute instances, or null to use DefaultTypeRegistry.

Return Value

ActionT
Generated delegate that will update T instances with update expression values applied.

Remarks

This function is useful for generating a delegate to a compiled function that will update objects of type T where properties of the type of have been decorated with UpdateValueExpressionAttribute attributes. The updated object will automatically have applied any defined update values as specified by the encountered attributes.

  Note

This function will assign evaluated expression values to properties in an existing model.

See Also