私は次のコード行使用して10以上の犬を持っている全ての人が年を取ることを試みた:レルムエラー:バイナリ演算子 'GreaterThan'のlhsはメンバ式でなければなりません。
var persons = realm.All<Person>()
.Where(person => person.Dogs.Count(dog=>dog.Age > 10) > 0);
をしかし、私はこのエラーを得た:
System.NotSupportedException:
The lhs of the binary operator 'GreaterThan' should be a member expression.
Unable to process `person.Dogs.Count(dog => (dog.Age > 10))`
それは我々がすることができないことを意味しています関係のフィルターをRealm
にしますか?
public class Dog : RealmObject
{
public string Name { get; set; }
public int Age { get; set; }
public Person Owner { get; set; }
}
public class Person : RealmObject
{
public string Name { get; set; }
public IList<Dog> Dogs { get; }
}
LINQのサポート:https://github.com/realm/realm-dotnet/blob/d83bb320189421924933c9a7160b9bf307a48861/Doxygen/linq-support.md – SushiHangover