Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions QueryBuilder/Include.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@ public class Include
public string ForeignKey { get; set; }
public string LocalKey { get; set; }
public bool IsMany { get; set; }

public Include Clone()
{
var clone = new Include();
clone.Name = this.Name;
clone.Query = this.Query.Clone();
clone.ForeignKey = this.ForeignKey;
clone.LocalKey = this.LocalKey;
clone.IsMany = this.IsMany;
return clone;
}
}
}
6 changes: 3 additions & 3 deletions QueryBuilder/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ internal int GetLimit(string engineCode = null)
public override Query Clone()
{
var clone = base.Clone();
clone.Parent = Parent;
clone.Parent = (Parent as Query)?.Clone();
clone.QueryAlias = QueryAlias;
clone.IsDistinct = IsDistinct;
clone.Method = Method;
clone.Includes = Includes;
clone.Variables = Variables;
clone.Includes = Includes.Select(i => i.Clone()).ToList();
clone.Variables = Variables.ToDictionary();
return clone;
}

Expand Down