Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the Clone() method in the Query class to perform deep cloning instead of shallow cloning, addressing issue #747. The fix ensures that nested objects like Parent queries and Includes are properly cloned rather than sharing references.
- Implements deep cloning for Parent query references
- Adds proper cloning for Includes collection with new Clone() method
- Creates independent copy of Variables dictionary
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| QueryBuilder/Query.cs | Updates Clone() method to deep clone Parent, Includes, and Variables properties |
| QueryBuilder/Include.cs | Adds new Clone() method to enable deep cloning of Include objects |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@cemahseri the PR is failing to build |
c3ae82e to
981f444
Compare
|
copilot is high on k2/spice, don't trust it. the pr builds just fine |
I was trying to build it locally but maybe I was missing something, I will try again tonight |
|
There was a recent PR inspired by this one that addresses this issue with a similar one related to the XQuery (coauthored with copilot) Thanks @cemahseri for the contribution |
|
you are welcome! so the ai did basically what i did, but slightly worse. but hey, it added the unit test! querybuilder/QueryBuilder/Query.cs Line 54 in 5122d43 it means that if i clone a query and make changes to the parent query of the copied query, the original query's parent query will also be changed |
Fixes: #747