LINQ projection with conditional null check and FirstOrDefault on nested array fails

XMLWordPrintableJSON

    • None
    • Dotnet Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      LINQ3 projection fails when using a conditional null check followed by Select().FirstOrDefault() on a nested array property. The workaround using the null-coalescing operator (??) or using .First() works correctly.

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      MongoDB 8.2.1 Community 

      Driver Version 3.5

       

            Assignee:
            Robert Stam
            Reporter:
            Janis Zinn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: