Create AstExpression extension methods to make testing for constants easier

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Unknown
    • 3.4.0
    • Affects Version/s: None
    • Component/s: LINQ
    • None
    • None
    • Fully Compatible
    • Dotnet Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      For example, instead of:

      if (node.FieldName is AstConstantExpression constantFieldName &&
          constantFieldName.Value.IsString &&
          constantFieldName.Value.AsString == "_elements")
      

      we could write:

      if (node.FieldName.IsStringConstant("_elements"))
      

              Assignee:
              Robert Stam
              Reporter:
              Robert Stam
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: