Skip to content

Instantly share code, notes, and snippets.

@alistairjevans
Last active May 25, 2019 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alistairjevans/fef974b5b5e47b01a5932968bcb757d1 to your computer and use it in GitHub Desktop.
Save alistairjevans/fef974b5b5e47b01a5932968bcb757d1 to your computer and use it in GitHub Desktop.
Still painful, but getting better
// Forgive me for this function name
KeyValuePair<string, string> KVP(string key, string val)
{
return new KeyValuePair<string, string>(key, val);
}
void Caller()
{
// Still pretty bad
SomeMethod(new List<KeyValuePair<string, string>> {
KVP("key1", "val1"),
KVP("key2", "val2")
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment