|
ValueExpressionParserTApplyDefaults(IEnumerablePropertyInfo, TypeRegistry) Method
|
Namespace: GSF.ComponentModelAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.205-beta+5ef4169f3b1079d8b163dd363614f656bd140924
Syntax Public Shared Function ApplyDefaults (
Optional properties As IEnumerable(Of PropertyInfo) = Nothing,
Optional typeRegistry As TypeRegistry = Nothing
) As Action(Of T)
static member ApplyDefaults :
?properties : IEnumerable<PropertyInfo> *
?typeRegistry : TypeRegistry
(* Defaults:
let _properties = defaultArg properties null
let _typeRegistry = defaultArg typeRegistry null
*)
-> Action<'T>
GSF.ComponentModel.ValueExpressionParser.ApplyDefaults = function(properties, typeRegistry);
View SourceParameters
- properties IEnumerablePropertyInfo (Optional)
- Specific properties to target, or null to target all properties.
- typeRegistry TypeRegistry (Optional)
-
Type registry to use when parsing DefaultValueExpressionAttribute instances, or null
to use DefaultTypeRegistry.
Return Value
ActionT
Generated delegate that will update
T instances with default 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
DefaultValueAttribute or
DefaultValueExpressionAttribute attributes.
The updated object will automatically have applied any defined default values as specified by
the encountered attributes.
Note |
---|
This function will assign evaluated expression values to properties in an existing model.
|
See Also