i'm trying to create a dictionary with a string key and a tuple value(string, bool). I'd like to make the tuple a named one, so something like:
Dictionary<string, (string, bool)> spColumnMapping = new Dictionary<string,
(string, bool)>();
Is it possible?
Thanks
void Main()
{
Dictionary<string, (string Foo, bool Bar)> spColumnMapping = new Dictionary<string, (string, bool)>();
spColumnMapping.Add("foo", ("Quax", false));
var x = spColumnMapping["foo"];
Console.WriteLine(x.Foo); // prints Quax
Console.WriteLine(x.Bar); // prints False
}
Just name the parameters after the type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With