This is a migrated thread and some comments may be shown as answers.

List creation conversion error

1 Answer 23 Views
Code Converter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gareth
Top achievements
Rank 1
Gareth asked on 01 Jul 2011, 10:49 AM
Hi,

According to the convertor:
C#
private static IQueryable<product> fake = new List<product> {
new product { name = "test", Price = 25 },
new product { name = "test", Price = 25 }}.AsQueryable();

Converts to:VB.NET
Private Shared fake As IQueryable(Of product) = New List(Of product)() With { _
    New product() With { _
        .name = "test", _
        .Price = 25 _
    }, _
    New product() With { _
        .name = "test", _
        .Price = 25 _
    } _
}.AsQueryable()

But that gives errors in Visual Studio. As far as I can tell it should be:
Private Shared fake As IQueryable(Of product) = New List(Of product) From{ _
New product() With { _
.name = "test", _
.Price = 25 _
}, _
New product() With { _
.name = "test", _
.Price = 25 _
} _
}.AsQueryable()

Thanks

Gareth

1 Answer, 1 is accepted

Sort by
0
Todd
Telerik team
answered on 01 Jul 2011, 09:31 PM
Hi Gareth,

Thanks for the report! We'll investigate the NRefactory engine (which powers the language conversions today) and see if updates are available that can address this scenario.

Hopefully we'll be able to fix this problem with a new version of NRefactory.

Thanks!
-Todd

Tags
Code Converter
Asked by
Gareth
Top achievements
Rank 1
Answers by
Todd
Telerik team
Share this question
or