Realm Xamarin  v0.81.0
Realm for Xamarin
Realm for Xamarin

The C# API of Realm is incredibly simple because it leverages the power of LINQ for querying and the Fody weaver to transform plain C# class declarations into persistent objects.

The main classes you will use are:

Helper classes you may use are:

Querying and Sorting are provided on a Realm using standard LINQ syntax including Where and OrderBy. To see what is supported, refer to the LINQ Support page.

Realm Overview Diagram


The documentation can be found at

The API reference is located at


Source is available on github.

Instructions on how to build from source are included in that repository's

Minimal Sample

This trivial sample shows the use of most of the classes mentioned above:

Note that in most debugging situations the default Realm will be retained so if you run this sample fragment multiple times you should see the number created increase. This is on purpose so you are assured the database is being persisted between runs.

using Realms;
class Hero : RealmObject
public string SuperName { get; set; }
public int SuperScore { get; set; }
/// put this code in an OnLoad or simple button-press handler
using (var realm = Realm.GetInstance())
realm.Write(() =>
realm.Add(new Hero
SuperName = "Thor",
SuperScore = 100
var numAwe = _realm.All<Hero>().Count();
System.Diagnostics.Debug.WriteLine($"Created {numAwe} heroes");

Problem reports and Feature requests

The github issue tracker can be used to report problems or make feature requests.