Class Cs.LetClause

java.lang.Object
org.openrewrite.csharp.tree.Cs.LetClause
All Implemented Interfaces:
Cs, Cs.QueryClause, org.openrewrite.java.tree.J, org.openrewrite.Tree
Enclosing interface:
Cs

public static final class Cs.LetClause extends Object implements Cs, Cs.QueryClause
Represents a let clause in a C# LINQ query expression that introduces a new range variable based on a computation.

For example:

     // Simple let clause
     from n in numbers
     let square = n * n
     select square

     // Multiple let clauses
     from s in strings
     let length = s.Length
     let upperCase = s.ToUpper()
     select new { s, length, upperCase }

     // Let with complex expressions
     from p in people
     let fullName = p.FirstName + " " + p.LastName
     let age = DateTime.Now.Year - p.BirthYear
     select new { fullName, age }
 
  • Constructor Details

    • LetClause

      public LetClause()
  • Method Details

    • getIdentifier

      public org.openrewrite.java.tree.J.Identifier getIdentifier()
    • withIdentifier

      public Cs.LetClause withIdentifier(org.openrewrite.java.tree.J.Identifier identifier)
    • acceptCSharp

      public <P> org.openrewrite.java.tree.J acceptCSharp(CSharpVisitor<P> v, P p)
      Specified by:
      acceptCSharp in interface Cs
    • getPadding

      public Cs.LetClause.Padding getPadding()