Skip to content

VB -> C#:Linq group by queries bugs #1180

@wizzardmr42

Description

@wizzardmr42

VB.Net input code

Dim result = From x in q Group By x.ID Into g Where g.AsEnumerable.Count > 1 Select g.ID

Erroneous output

var result = from x in q
group x by x.ID into Group
where g.AsEnumerable.Count > 1
select g.ID;

Expected output

var result = from x in q
group x by x.ID into g
where g.AsEnumerable.Count() > 1
select g.ID;

Details

https://icsharpcode.github.io/CodeConverter/ and latest extension version
nb. 2 issues - group name isn't coming through as "g" and Count is being treated as a property instead of a function call

Metadata

Metadata

Assignees

No one assigned

    Labels

    VB -> C#Specific to VB -> C# conversioncompilation errorA bug where the converted output won't compileneeds-reproNeeds either the input that caused the error, or more information to allow reproducing the error

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions