-
Type: Bug
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
What happened?
I have Journal and JournalEntry classes per the definitions below. During startup, some sample data is created including 3 Journal objects each with either two or three JournalEntry objects attached. Subsequently, I use the following query to retrieve the list of Journals.
`
var journalList = new ObservableCollection<Journal>(_realm.All<Journal>().OrderBy(x => x.Date).ToList());
`
All three of the Journal objects retrieved have an empty Entries list (i.e. list count is zero).
I'm not sure which package upgrade caused this to stop working.
Repro steps
Interestingly though, if I migrate all objects to partial classes and use interfaces (i.e IRealmObject) it starts working again. However, this appears to bring heaps of pain with compiler nullability warnings left, right, and centre that I cannot seem to resolve.
Version
Realm 12.3.
What Atlas Services are you using?
Local Database only
What type of application is this?
Other
Client OS and version
macOS 14.5; NET MAUI 8; C# 12
Code snippets
public class Journal : RealmObject { [PrimaryKey] [MapTo("_id")] public string Id { get; set; } = Guid.NewGuid().ToString(); [MapTo("date")] public DateTimeOffset Date { get; set; } [MapTo("counterparty")] public Counterparty Counterparty { get; set; } = new (); [MapTo("memo")] public Memo? Memo { get; set; } [MapTo("reporting_group")] public ReportingGroup? ReportingGroup { get; set; } [MapTo("amount")] public decimal Amount { get; set; } [MapTo("entries")] public IList<JournalEntry> Entries { get; } = []; } public class JournalEntry : EmbeddedObject { [MapTo("_id")] public string Id { get; set; } = Guid.NewGuid().ToString(); [MapTo("account")] public Account Account { get; set; } = new(); [MapTo("currency")] public Currency Currency { get; set; } = new(); [MapTo("amount")] public decimal Amount { get; set; } [MapTo("is_credit")] public bool IsCredit { get; set; } }
Stacktrace of the exception/crash you're getting
No response
Relevant log output
No response