var query =The reason is pretty simple: we don't replace method calls on primitive types to their versions performing null checks while compiling the query for Memory storage. So if this code will be executed on IMDB, it has a chance to fail with NullReferenceException in FilterProvider iterator.
from c in Query<Person>.All
where c.FirstName.ToLower()=="alex"
select c;
foreach (var c in query)
Console.WriteLine(c.FirstName);
Currently you can workaround this issue by e.g. this code:
var query =But as you might suspect, this can affect on query plans in SQL. So better option is to make DataObjects.Net to handle this. That's exactly what we're going to implement in the near future.
from c in Query<Person>.All
where (c.FirstName ?? string.Empty).ToLower()=="alex"
select c;
foreach (var c in query)
Console.WriteLine(c.FirstName);
No comments:
Post a Comment