Class ManagedAccessor
Represents the base class for an accessor to be used with a managed object.
Implements
Namespace: Realms
Assembly: Realm.dll
Syntax
public abstract class ManagedAccessor : 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
public 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
public 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
public 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
public 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
public 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
public 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
public Realm Realm { get; }
Property Value
Type | Description |
---|---|
Realm | The Realm instance this object belongs to. |
Methods
| Improve this Doc View SourceFinalize()
Finalizes an instance of the ManagedAccessor class.
Declaration
protected void Finalize()
GetBacklinks(String, String)
Returns all the objects that link to this object in the specified relationship.
Declaration
[Obsolete("Use realmObject.DynamicApi.GetBacklinksFromType() instead.")]
public IQueryable<dynamic> GetBacklinks(string objectType, string property)
Parameters
Type | Name | Description |
---|---|---|
String | objectType | The type of the object that is on the other end of the relationship. |
String | property | The property that is on the other end of the relationship. |
Returns
Type | Description |
---|---|
IQueryable<Object> | A queryable collection containing all objects of |
GetBacklinks<T>(String)
Gets the value of a backlink property. This property must have been declared explicitly and annotated with BacklinkAttribute.
Declaration
public 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
public 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
public 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
public IRealmObjectBase GetParent()
Returns
Type | Description |
---|---|
IRealmObjectBase | The parent of the embedded object. |
GetSetValue<T>(String)
Gets the ISet<T> property of the object.
Declaration
public 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
public 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
public 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
public 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
public 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
public void SubscribeForNotifications(Action<string> notifyPropertyChangedDelegate)
Parameters
Type | Name | Description |
---|---|---|
Action<String> | notifyPropertyChangedDelegate | The delegate invoked when a notification is raised. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceUnsubscribeFromNotifications()
A method called internally to unsubscribe to the notifications for the associated object.
Declaration
public void UnsubscribeFromNotifications()