This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, it seems I'm not allowed to have this (p.Scc == null ? "" : p.Scc) != "D" in my lambda expression.
I wanted to filter by code where it grabs everything but Fish.
so simple right? p => p.Code != "X" But it gives me Car and Dog only. If I put p.Code == "X", it gives me Fish as expected And if I leave the expression out. It gives me everything including the Apple and Ball. So, what now? |
|
|
|
This is actually behavior being driven by your database provider, nulls will be ignored because you havnt explicitely said that the criteria can either be null or not null. You can update your query to p => p.Code == null || p.Code != "X" to achieve what you are looking for. For the exception you were seeing above, this relates to the use of the conditional expression which was not originally supported in LightSpeed 3 but we have subsequently added support for this in more recent nightly builds so you can grab a nightly if you need to use this type of expression in the future :)
Jeremy |
|