Struct KeyPath
Represents a key path that can be used as a part of a KeyPathsCollection when subscribing for notifications.
A KeyPath can be implicitly built from a string, where the string is the name of a property (e.g "FirstName"), eventually dotted to indicated nested properties.
(e.g "Dog.Name"). Wildcards can also be used in key paths to capture all properties at a given level (e.g "", "Friends." or "*.FirstName").
A KeyPath can also be built using the ForExpression<T>(Expression<Func<T, object?>>) method, that creates the KeyPath corresponding
to the property path represented by the input expression.
Assembly: Realm.dll
Syntax
public readonly struct KeyPath
Methods
|
Edit this page
View Source
ForExpression<T>(Expression<Func<T, object?>>)
Declaration
public static KeyPath ForExpression<T>(Expression<Func<T, object?>> expression) where T : IRealmObject
Parameters
Type |
Name |
Description |
Expression<Func<T, object>> |
expression |
The expression specifying the path to the property.
|
Returns
Type |
Description |
KeyPath |
A KeyPath representing the full path to the specified property.
|
Type Parameters
Examples
var keyPath = KeyPath.For<Person>(p => p.Dog.Name);
Operators
|
Edit this page
View Source
operator ==(KeyPath, KeyPath)
Declaration
public static bool operator ==(KeyPath left, KeyPath right)
Parameters
Returns
|
Edit this page
View Source
implicit operator KeyPath(string)
Declaration
public static implicit operator KeyPath(string s)
Parameters
Type |
Name |
Description |
string |
s |
|
Returns
|
Edit this page
View Source
operator !=(KeyPath, KeyPath)
Declaration
public static bool operator !=(KeyPath left, KeyPath right)
Parameters
Returns