Good Day,
Is it possible (with the .NET-SDK) to produce a Database, which would look like the following example?
Suppose I Have a Class Dog
and Owner
public class Owner : RealmObject
{
[PrimaryKey, MapTo("id")]
public int ID { get; init; }
[MapTo("name"), Required]
public string Name { get; set; }
[MapTo("dogs"), Backlink(nameof(Dog.Owner))]
public IQueryable<Dog> Dogs { get; }
}
public class Dog : RealmObject
{
[PrimaryKey, MapTo("id")]
public int ID { get; init; }
[MapTo("name"), Required]
public string Name { get; set; }
[MapTo("owner")]
public Owner Owner { get; set; }
}
This produces a Database, where each Owner
has two columns and each Dog
has three columns.
Each dog contains a reference to its owner.
Is it possible to additionally reference from a Owner
to its dogs, without losing the reference back to the Owner
?
I found some code using the Swift-SDK, which used LinkingObjects
. This code seemed to achieve what I want, but LinkingObjects
are not available in .NET.