Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2708

Verify scenarios involving string.IsNullOrEmpty with or without null coalescing in argument

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.14.0
    • Affects Version/s: None
    • Component/s: LINQ3

      This works

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      Poject(p=> p.PropertyName??"") 
      

      But in the where clause of a LINQ query

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      where string.IsNullOrEmpty(product.PropertyName??"")
      

      I get the error

      InvalidOperationException: ({document}{propertyName} ?? "") is not supported.
      MongoDB.Driver.Linq.Translators.PredicateTranslator.GetFieldExpression(Expression expression)
      

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            rcollette@yahoo.com Richard Collette
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: