Hi have just started using Realm dotnet
When I perform a simple query like
var results = realm.All().Where(x => x.Property == o
The answer provided by Will does work e.g. you have to copy the query term into a separate variable
var queryTerm = otherVariable.Property;
var results = realm.All<MyRealmType>().Where(x => x.Property == queryTerm);
Maybe someone from Realm can explain why this is, and whether it will be fixed in the future. I suspect it has something to do with the Weaver. Just a guess.
Thanks again Will
Try this (it works for me):
System.Func<YourItem, bool> predicate = (YourItem item) =>
{
return !item.BoolProperty && item.ParentID == parent?.ID;
};
return Realms.Realm.GetInstance().All<YourItem>().Where(predicate).OrderBy(item => item.Position).ToList();