In later C# versions you can use pattern matching with logical patterns, specifically or in this case (assuming list is IEnumerable<> since the newer language features usually are not supported by expression trees) and constants:
const int desiredIntValue = 1;
list.Where(x=> x.a.b is null or desiredIntValue)
For non-constant values you can do something like:
In later C# versions you can use pattern matching with logical patterns, specifically
orin this case (assuming list isIEnumerable<>since the newer language features usually are not supported by expression trees) and constants:For non-constant values you can do something like:
Or for nullable value types
But not sure if it can be considered as shorthand.