Class CompiledPropertyPath
Represents the property path whose value is compiled for the faster execution.
public sealed class CompiledPropertyPath : PropertyPath, IPropertyPath, IReadOnlyPropertyPath
- Inheritance
-
CompiledPropertyPath
- Implements
- Inherited Members
- Extension Methods
Constructors
CompiledPropertyPath(string, Type, PropertyRegistry?)
Initializes a new instance of the CompiledPropertyPath class.
public CompiledPropertyPath(string path, Type typeContext, PropertyRegistry? registry = null)
Parameters
pathstringThe path to access an object.
typeContextTypeThe type to get info about properties.
registryPropertyRegistryThe registry to resolve registered properties through, or null to capture Current at construction time. See the remarks on PropertyPath(string, Type, PropertyRegistry?).
Methods
GetValue(object)
Gets the value by calling the property chain for the specified source object.
public override object? GetValue(object source)
Parameters
sourceobjectAn object to retrieve value from.
Returns
- object
The value by the specified property path.
Remarks
Returns null when a value along the path is null, the same as a DynamicPropertyPath. Exceptions thrown by a getter itself propagate.
SetValue(object, object?)
Sets the value by calling the property chain for the specified target object.
public override void SetValue(object target, object? value)
Parameters
Remarks
Does nothing when the object the last member is set on, or a value on the way to it, is null, the same as a DynamicPropertyPath. Exceptions thrown by a getter or the setter itself propagate.