VB -> C#: "Group By Into" Linq queries supressing aggregations ("Into" part) in the converted code
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
Research direction
Run the supplied VB.NET LINQ input through codeconv.exe and compare its output with the expected C# query. Trace the LINQ Group By/Into conversion entry point and add coverage for the grouped key properties and Max aggregation; done means the reproduced input emits the expected Group.Key and Group.Max expressions.
Written by the indexing model from the issue text.
Description
VB.Net input code
Public Class Entity
Public Property Property1 As String
Public Property Property2 As String
Public Property Value As Decimal
End Class
Dim entityCollection As IEnumerable(Of Entity)
Dim queryMax = From item In entityCollection
Where item.Property1 = "dummy"
Group By item.Property1, item.Property2
Into ValueMax = Max(item.Value)
Select New With {
Property1, Property2, ValueMax
}
Erroneous output
var queryMax = from item in entityCollection
where item.Property1 == "dummy"
group item by new { item.Property1, item.Property2 } into Group
select new { Property1, Property2, ValueMax };
Expected output
var queryMax = from item in entityCollection
where item.Property1 == "dummy"
group item by new { item.Property1, item.Property2 } into Group
select new { Property1 = Group.Key.Property1, Property2 = Group.Key.Property2, ValueMax = Group.Max(i => i.Value) };
Details
- Product in use: codeconv.exe (dotnet tool)
- Version in use: 10.0.1.92
- Did you see it working in a previous version, which? No
- Dominant language
- C#
- Stars
- 913
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from icsharpcode/CodeConverter
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
icsharpcode/CodeConverter#1271 · 1 comment ·
-
C# -> VB
Difficulty 4/5 3-5 days Newbie friendliness 35/100
icsharpcode/CodeConverter#1281 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
icsharpcode/CodeConverter#1275 ·
-
VB -> C#
Difficulty 3/5 1-2 days Newbie friendliness 62/100
icsharpcode/CodeConverter#1273 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
icsharpcode/CodeConverter#1270 ·
All issues in icsharpcode/CodeConverter
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·