Hi,
In relation to this thread, what would be the best recommended way to have a null value in an object relationship?
For instance, I have an object as follows:
public class Template : RealmObject
{
[PrimaryKey]
[MapTo("_id")]
public int TemplateId { get; set; }
public string TemplateDescription { get; set; }
public Department Department { get; set; }
public Example Example{ get; set; }
}
Where Department and Example are Realm objects.
When this is inserted into the realm by my .Net app, the entry in the MongoDB is as follows:
{
"_id":{"$numberLong":"123"},"
_partitionKey":"key",
"Example":null,
"Department":null,
"TemplateDescription":"Example"
}
This fails validation because of the null values of Department and Example even though it still syncs with the app.
How do you suggest I implement this as you can’t create a default Realm Object to use in a relationship?
Many Thanks