DB4o Linq query - How to check for null rows

Hey there - a simple request:

var q = (from SomeObject o in container
    where 
 o.SomeInt > 8 
 && o.SomeString != null //Null Ref here
    select o;

I always get a null reference exception.

If I use String.IsNullOrEmpty (o.SomeString), the request takes about 100 times, as if I used && o.SomeString! = "" (This is faster, but obviously wrong).

I assume that DB4o needs to activate objects in order to pass them to an IsNullOrEmpty call and cannot use indexes.

My question is: what is the best way to check for zeros in this situation? Is there something like: mystring! = Db4o.DBNull.Value or something?

Cheers, dave

+3
source share
1 answer

- . . . db4o SODA-Queries .

db4o ? , NullRefrence-Exception LINQ-Queries. .

Db4objects.Db4o.Linq.dll . ?

String.IsNullOrEmpty , . , SODA. LINQ Object, .

+3

Source: https://habr.com/ru/post/1750480/


All Articles