Realm dotnet - The rhs of the binary operator 'Equal' should be a constant or closure variable expression

前端 未结 2 1433
抹茶落季
抹茶落季 2020-12-19 11:10

Hi have just started using Realm dotnet

When I perform a simple query like

var results = realm.All().Where(x => x.Property == o         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 11:51

    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().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

提交回复
热议问题