Returns

Remarks

If the object is already managed by this Realm, this method does nothing.
This method modifies the object in-place, meaning that after it has run, obj will be managed.
Cyclic graphs (Parent has Child that has a Parent) will result in undefined behavior.
You have to break the cycle manually and assign relationships after all object have been managed.

Returns

Type Parameters

Name

Description

T

The Type T must not only be a RealmObject but also have been processed by the Fody weaver,
so it has persistent properties.

Remarks

If the object is already managed by this Realm, this method does nothing.
This method modifies the object in-place, meaning that after it has run, obj will be managed.
Returning it is just meant as a convenience to enable fluent syntax scenarios.
Cyclic graphs (Parent has Child that has a Parent) will result in undefined behavior.
You have to break the cycle manually and assign relationships after all object have been managed.

Parameters

Returns

Remarks

The realm file must not be open on other threads.
The file system should have free space for at least a copy of the Realm file.
This method must not be called inside a transaction.
The Realm file is left untouched if any file operation fails.

Parameters

Returns

Remarks

WARNING: if the dynamic object has a PrimaryKey then that must be the first property set
otherwise other property changes may be lost.

If the realm instance has been created from an un-typed schema (such as when migrating from an older version
of a realm) the returned object will be purely dynamic. If the realm has been created from a typed schema as
is the default case when calling GetInstance(RealmConfigurationBase) the returned
object will be an instance of a user-defined class, as if created by CreateObject<T>().

Declaration

Parameters

Remarks

Creates its own temporary Transaction and commits it after running the lambda passed to action.
Be careful of wrapping multiple single property updates in multiple Write(Action) calls.
It is more efficient to update several properties or even create multiple objects in a single Write(Action),
unless you need to guarantee finer-grained updates.

Parameters

Returns

Remarks

Opens a new instance of this Realm on a worker thread and executes action inside a write Transaction.
Realms and RealmObjects are thread-affine, so capturing any such objects in
the action delegate will lead to errors if they're used on the worker thread. Note that it checks the
SynchronizationContext to determine if Current is null, as a test to see if you are on the UI thread
and will otherwise just call Write without starting a new thread. So if you know you are invoking from a worker thread, just call Write instead.