This project is read-only.

params to Dictionary<string,T>

Topics: C# Language Design
Jul 24, 2015 at 3:17 PM

params to Dictionary<string,T>

Here is something that I thought that should be in C#

if we want a collection of named params in a function
public void Func1(params Dictionary<string,object> keyValuePairs)
{
        //SOME WORK...
}

//Call

Func1(Key1:"VALUE1",Key2:"VALUE2"...);

I see a lot of use case for something like this.

#For example 
String.Format("{a}  is not {b}",a:"C#",b:"Java");
just an idea to think about.
Jul 24, 2015 at 5:55 PM
Discussions have moved to: https://github.com/dotnet/roslyn/issues