LINQ .Any(x => !list.Contains(x)) translates incorrectly.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.8.0
    • Affects Version/s: 2.0.1
    • Component/s: LINQ
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have a document with two arrays, one is a collection of string tags and the other is a collection of sub documents. I have created a mongo update that removes a sub document if any of the tags for the documents array are not in the provided list. When I execute the update I'm getting an IndexOutOfRangeException.

      I've created a sample project to reproduce the bug which can be found here.
      https://github.com/nickmkk/UpdateWhereItemsArentInProvidedList

      Run the tests in RemoveSubEntityServiceTests.cs to reproduce the issue.

      Note that the problem seems to be with the filter in RemoveSubEntityService.cs on line 25

        1. Program.cs
          3 kB
          Robert Stam

              Assignee:
              Dmitry Lukyanov (Inactive)
              Reporter:
              Nicholas Markkula
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: