Allow anonymous object for selecting fields/properties at Exclude and Include#2488
Conversation
Pull Request Test Coverage Report for Build 7036088817
💛 - Coveralls |
552be02 to
c1e2441
Compare
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
upload-result: trueContact Qodana teamContact us at [email protected]
|
e869e49 to
1a87f18
Compare
Exclude and Include
1a87f18 to
1ac4b66
Compare
|
Hmm.. discovered a bad bug... Will fix it in the evening 🫣 |
1ac4b66 to
85cba3f
Compare
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
8191b33 to
b363b4b
Compare
Pull Request Test Coverage Report for Build 11767671047Details
💛 - Coveralls |
b363b4b to
ba177ab
Compare
6aa70b4 to
fb28d7f
Compare
dennisdoomen
left a comment
There was a problem hiding this comment.
👍🏻 Very nice feature
🔧 We only use var if the type is obvious.
| segments.Add($"[{argumentExpression.Value}]"); | ||
| singlePath = $"[{argumentExpression.Value}].{singlePath}"; | ||
| break; | ||
| case ExpressionType.New: |
There was a problem hiding this comment.
♻️ This entire method is become too bloated and needs some refactoring (but maybe not now). An implementation of the Strategy Pattern might be a better fit.
|
|
||
| IEnumerable<string> reversedSegments = segments.AsEnumerable().Reverse(); | ||
| string segmentPath = string.Join(".", reversedSegments); | ||
| if (singlePath is null) |
There was a problem hiding this comment.
❓ What happens if singlePath is non-null and selectors isn't empty?
There was a problem hiding this comment.
As I can see, this cannot happen, because you either have: .Excluding(p => p.NestedField)(which results in singlePath to be non-null and segments to be empty) or .Excluding(p => new { p.NestedField } ) (which results in singlePath null + segments not empty).
There was a problem hiding this comment.
My point was that the code doesn't make that clear.
There was a problem hiding this comment.
Should I add a comment for this?
There was a problem hiding this comment.
Actually, we have do do it exactly like this, because in case of .Excluding(p => new { }) singlePath stays null and the segments stays empty.
There was a problem hiding this comment.
In that case, I would make it an if, else if and else. Even though the huge switch is difficult to process, you at least can see what will happen at the end.
Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs
Outdated
Show resolved
Hide resolved
d3d766f to
fe0e37c
Compare
|
I think I've addressed all the blocking changes. |
This refers to `Excluding` / `For.Exclude` and `Including`
Co-authored-by: Dennis Doomen <[email protected]>
Co-authored-by: Dennis Doomen <[email protected]>
fe0e37c to
b0c2ff7
Compare
This refers to
Excluding()/.For().Exclude()andIncluding().This closes #2479
IMPORTANT
./build.sh --target spellcheckor.\build.ps1 --target spellcheckbefore pushing and check the good outcome