c# collection initializer doesn't convert to vb correctly

1 posts, 0 answers
  1. Mhano Harkness
    Mhano Harkness avatar
    1 posts
    Member since:
    Feb 2010

    Posted 11 Mar 2013 Link to this post

    It should use the "From" keyword instead of the "With".

    Cheers,
    Mhano

    new List<a>{
            new a{b="w",c="x"},
            new a{b="y",c="z"},
            }

    Gives:

    New List(Of a)() With { _
    New a() With { _
    .b = "w", _
    .c = "x" _
    }, _
    New a() With { _
    .b = "y", _
    .c = "z" _
    } _
    }

    Instead of:

    New List(Of a)() From { _ ...
Back to Top