ValueExpressionParserTUpdateInstanceTExpressionScope(IEnumerablePropertyInfo, TypeRegistry) Method

Generates a delegate that will update an instance of type T accepting a contextual IValueExpressionScopeT object parameter applying any specified UpdateValueExpressionAttribute instances that are declared on the type T properties. Target T instance needs to be assigned to the Instance property prior to call.

Definition

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

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.

Type Parameters

TExpressionScope
IValueExpressionScopeT parameter type.

Return Value

ActionTExpressionScope
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. The generated delegate takes a parameter to a contextual object useful for providing extra runtime data to UpdateValueExpressionAttribute attributes; the parameter must be derived from IValueExpressionScopeT. Any public fields, methods or properties defined in the derived class will be automatically accessible from the expressions declared in the UpdateValueExpressionAttribute attributes. By default, the expressions will have access to the current T instance by referencing the this keyword, which is an alias to Instance.

  Note

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

See Also