[CSHARP-3836] LINQ3: Add the virtual CanBeRenderedAsPath method to AstExpression Created: 06/Sep/21  Updated: 28/Oct/23  Resolved: 04/Oct/21

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: None
Fix Version/s: 2.14.0

Type: Task Priority: Unknown
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-3320 LINQ3: Move GroupBy accumulators back... Closed
Epic Link: CSHARP-2608

 Description   

The LINQ3 translator at times need to know if an AstExpression can be rendered as a path of the form "$x.y.z" or "$$var.x.y.z".

This question is most easily answered by defining a new virtual method

  • the default implementation of CanBeRenderedAsPath returns false
  • AstVarExpression overrides CanBeRenderedAsPath and returns true
  • AstGetFieldExpression overrides CanBeRenderedAsPath and returns true if the Input CanBeRenderedAsPath and the field name is safe to use in a path

Generated at Wed Feb 07 21:46:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.