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

XMLWordPrintableJSON

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

      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 Stam
            Reporter:
            Richard Collette
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: