I suggest you ...

Support C# Add() extension methods for collection initializers (like in VB.NET)

Collection Initializer should consider Add() extension methods as well as the built-in ones, which would allow custom code like this:

var l = new List<string> { {10,'a'}, {20,'b'} };

Assuming there exists an extension method

void Add(this List<string>, int, char)

Even Microsoft reported that it would be a good idea, but the issue got closed without a followup: https://connect.microsoft.com/VisualStudio/feedback/details/

33 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    yurikyurik shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.

    - The Visual Studio Team

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base