Interface IRealmAccessor
Represents an accessor that encapsulates the methods and properties necessary for interfacing with the associated Realm object.
Namespace: Realms
Assembly: Realm.dll
Syntax
public interface IRealmAccessor
Properties
| Improve this Doc View SourceBacklinksCount
Gets the number of objects referring to this one via either a to-one or to-many relationship.
Declaration
int BacklinksCount { get; }
Property Value
Type | Description |
---|---|
Int32 | The number of objects referring to this one. |
Remarks
This property is not observable so the PropertyChanged event will not fire when its value changes.
DynamicApi
Gets an object encompassing the dynamic API for this RealmObjectBase instance.
Declaration
DynamicObjectApi DynamicApi { get; }
Property Value
Type | Description |
---|---|
DynamicObjectApi | A Realms.Dynamic instance that wraps this RealmObject. |
IsFrozen
Gets a value indicating whether this object is frozen. Frozen objects are immutable and will not update when writes are made to the Realm. Unlike live objects, frozen objects can be used across threads.
Declaration
bool IsFrozen { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
See Also
IsManaged
Gets a value indicating whether the object has been associated with a Realm, either at creation or via Add<T>(T, Boolean).
Declaration
bool IsManaged { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
IsValid
Gets a value indicating whether this object is managed and represents a row in the database. If a managed object has been removed from the Realm, it is no longer valid and accessing properties on it will throw an exception. Unmanaged objects are always considered valid.
Declaration
bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
ObjectSchema
Gets the ObjectSchema instance that describes how the Realm this object belongs to sees it.
Declaration
ObjectSchema ObjectSchema { get; }
Property Value
Type | Description |
---|---|
ObjectSchema | A collection of properties describing the underlying schema of this object. |
Realm
Gets the Realm instance this object belongs to, or null
if it is unmanaged.
Declaration
Realm Realm { get; }
Property Value
Type | Description |
---|---|
Realm | The Realm instance this object belongs to. |
Methods
| Improve this Doc View SourceGetBacklinks<T>(String)
Gets the value of a backlink property. This property must have been declared explicitly and annotated with BacklinkAttribute.
Declaration
IQueryable<T> GetBacklinks<T>(string propertyName)
where T : IRealmObjectBase
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the backlink property. |
Returns
Type | Description |
---|---|
IQueryable<T> | A queryable collection containing all objects pointing to this one via the property specified in Realms.BacklinkAttribute.Property. |
Type Parameters
Name | Description |
---|---|
T | The type of the object that is on the other end of the relationship. |
GetDictionaryValue<TValue>(String)
Gets the IDictionary<TKey,TValue> property of the object.
Declaration
IDictionary<string, TValue> GetDictionaryValue<TValue>(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Returns
Type | Description |
---|---|
IDictionary<String, TValue> | The value of the IDictionary<TKey,TValue> property. |
Type Parameters
Name | Description |
---|---|
TValue | The type of values in the dictionary. |
GetListValue<T>(String)
Gets the IList<T> property of the object.
Declaration
IList<T> GetListValue<T>(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Returns
Type | Description |
---|---|
IList<T> | The value of the IList<T> property. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the collection. |
GetParent()
Gets the parent of the embedded object. It can be either another embedded object, a standalone realm object, or an asymmetric object.
Declaration
IRealmObjectBase GetParent()
Returns
Type | Description |
---|---|
IRealmObjectBase | The parent of the embedded object. |
GetSetValue<T>(String)
Gets the ISet<T> property of the object.
Declaration
ISet<T> GetSetValue<T>(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Returns
Type | Description |
---|---|
ISet<T> | The value of the ISet<T> property. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the collection. |
GetTypeInfo(IRealmObjectBase)
Gets the TypeInfo of the input object.
Declaration
TypeInfo GetTypeInfo(IRealmObjectBase obj)
Parameters
Type | Name | Description |
---|---|---|
IRealmObjectBase | obj | The object to derive the TypeInfo from. |
Returns
Type | Description |
---|---|
TypeInfo | The TypeInfo of the input object. |
GetValue(String)
Gets the value of a property of the object.
Declaration
RealmValue GetValue(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Returns
Type | Description |
---|---|
RealmValue | The value of the property. |
Remarks
This method cannot be used with collection properties. Please use one of the collection-specific methods for that.
SetValue(String, RealmValue)
Set the value of a property of the object.
Declaration
void SetValue(string propertyName, RealmValue val)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
RealmValue | val | The value to set. |
Remarks
This method cannot be used with collection properties.
SetValueUnique(String, RealmValue)
Set the value of the primary key of the object.
Declaration
void SetValueUnique(string propertyName, RealmValue val)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the primary key property. |
RealmValue | val | The value to set. |
SubscribeForNotifications(Action<String>)
A method called internally to subscribe to the notifications for the associated object.
Declaration
void SubscribeForNotifications(Action<string> notifyPropertyChangedDelegate)
Parameters
Type | Name | Description |
---|---|---|
Action<String> | notifyPropertyChangedDelegate | The delegate invoked when a notification is raised. |
UnsubscribeFromNotifications()
A method called internally to unsubscribe to the notifications for the associated object.
Declaration
void UnsubscribeFromNotifications()