Skip to content

Commit

Permalink
Allow cloning joins
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Sep 27, 2023
1 parent d2e072f commit 55acc58
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MarkMpn.Sql4Cds.Engine/TSqlFragmentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,18 @@ public static T Clone<T>(this T fragment) where T : TSqlFragment
return (T)(object)clone;
}

if (fragment is QualifiedJoin qualifiedJoin)
{
return (T)(object)new QualifiedJoin
{
FirstTableReference = qualifiedJoin.FirstTableReference.Clone(),
JoinHint = qualifiedJoin.JoinHint,
QualifiedJoinType = qualifiedJoin.QualifiedJoinType,
SearchCondition = qualifiedJoin.SearchCondition?.Clone(),
SecondTableReference = qualifiedJoin.SecondTableReference.Clone()
};
}

if (fragment is GroupByClause groupBy)
{
var clone = new GroupByClause
Expand Down

0 comments on commit 55acc58

Please sign in to comment.