Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
2.2.3
-
None
Description
As posted here:
http://stackoverflow.com/questions/35863999/query-mongodb-sublists-with-c-sharp-linq-regex
Regex IsMatch does not seem to work on list-properties although the same LINQ query runs fine on a standard list.
I.e. given
public class Car
{ public string Name; public List<string> Colors; }this only works for plain list LINQ:
var regex = new Regex("^Blue.*");
var matchingCars = carCollection.Where(x => x.Colors.Any(y => regex.IsMatch
));
The above just silently returns an empty queryable.