|
ValueExpressionParserTCreateInstance(IEnumerablePropertyInfo, TypeRegistry) Method
|
Namespace: GSF.ComponentModelAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax Public Shared Function CreateInstance (
Optional properties As IEnumerable(Of PropertyInfo) = Nothing,
Optional typeRegistry As TypeRegistry = Nothing
) As Func(Of T)
static member CreateInstance :
?properties : IEnumerable<PropertyInfo> *
?typeRegistry : TypeRegistry
(* Defaults:
let _properties = defaultArg properties null
let _typeRegistry = defaultArg typeRegistry null
*)
-> Func<'T>
GSF.ComponentModel.ValueExpressionParser.CreateInstance = 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
FuncT
Generated delegate that will create new
T instances with default values applied.
Remarks
This function is useful for generating a delegate to a compiled function that will create new
objects of type
T where properties of the type of have been decorated with
DefaultValueAttribute or
DefaultValueExpressionAttribute attributes.
The newly created 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 a newly created model.
|
See Also