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/

28 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 →

    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