Click or drag to resize

ValueExpressionParserTUpdateProperties Method

Generates a delegate that will update an instance of type T assigning values from TypeConvertedValueExpressionAttribute instances that are declared on the type T properties to the property values. Target T instance is accepted as the parameter to the returned delegate ActionT.

Namespace: GSF.ComponentModel
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
public static Action<T> UpdateProperties(
	IEnumerable<PropertyInfo> properties = null,
	TypeRegistry typeRegistry = null
)
View Source

Parameters

properties  IEnumerablePropertyInfo  (Optional)
Specific properties to target, or null to target all properties.
typeRegistry  TypeRegistry  (Optional)
Type registry to use when parsing TypeConvertedValueExpressionAttribute 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 TypeConvertedValueExpressionAttribute attributes. The updated object will automatically have applied any defined update values as specified by the encountered attributes.

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

This method is the inverse call for UpdateExpressions(IEnumerablePropertyInfo, TypeRegistry). Internally the method simply calls UpdateInstanceForTypeTValueExpressionAttribute(IEnumerablePropertyInfo, TypeRegistry) for type TypeConvertedValueExpressionAttribute.

See Also