Realm Xamarin  v0.81.0
Realm for Xamarin
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Realms.RealmObject Class Reference

Base for any object that can be persisted in a Realm. More...

Inherits IReflectableType, and INotifyPropertyChanged.

Inherited by Realms.Dynamic.DynamicRealmObject.

Collaboration diagram for Realms.RealmObject:
Collaboration graph
[legend]

Public Member Functions

override bool Equals (object obj)
 Compare objects with identity query for persistent objects. More...
 

Public Attributes

bool IsManaged => _realm != null
 Gets a value indicating whether the object has been associated with a Realm, either at creation or via Realm.Add. More...
 
bool IsValid => _objectHandle?.IsValid != false
 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. More...
 
Schema.ObjectSchema ObjectSchema => _metadata?.Schema
 Gets the Schema.ObjectSchema instance that describes how the Realm this object belongs to sees it. More...
 
Realm Realm => _realm
 Gets the Realm instance this object belongs to, or More...
 

Protected Member Functions

void RaisePropertyChanged ([CallerMemberName] string propertyName=null)
 Allows you to raise the PropertyChanged event. More...
 

Properties

PropertyChangedEventHandler PropertyChanged
 Occurs when a property value changes. More...
 

Detailed Description

Base for any object that can be persisted in a Realm.

Has a Preserve attribute to attempt to preserve all subtypes without having to weave.

Member Function Documentation

§ Equals()

override bool Realms.RealmObject.Equals ( object  obj)

Compare objects with identity query for persistent objects.

Persisted RealmObjects map their properties directly to the realm with no caching so multiple instances of a given object always refer to the same store.

Parameters
objObject being compared against to see if is the same C# object or maps to the same managed object in Realm.
Returns
True when objects are the same memory object or refer to the same persisted object.

§ RaisePropertyChanged()

void Realms.RealmObject.RaisePropertyChanged ( [CallerMemberName] string  propertyName = null)
protected

Allows you to raise the PropertyChanged event.

Parameters
propertyNameThe name of the property that has changed. If not specified, we'll use the caller name.

Member Data Documentation

§ IsManaged

bool Realms.RealmObject.IsManaged => _realm != null

Gets a value indicating whether the object has been associated with a Realm, either at creation or via Realm.Add.

Referenced by Realms.Realm.Add(), and Realms.Realm.Remove().

§ IsValid

bool Realms.RealmObject.IsValid => _objectHandle?.IsValid != false

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.

§ ObjectSchema

Schema.ObjectSchema Realms.RealmObject.ObjectSchema => _metadata?.Schema

Gets the Schema.ObjectSchema instance that describes how the Realm this object belongs to sees it.

§ Realm

Realm Realms.RealmObject.Realm => _realm

Gets the Realm instance this object belongs to, or

null if it is unmanaged.

Referenced by Realms.Realm.Add().

Property Documentation

§ PropertyChanged

PropertyChangedEventHandler Realms.RealmObject.PropertyChanged
addremove

Occurs when a property value changes.