sobota 16. října 2010

void Dictionary.Add(TK key, TV value)

Oh my. Why the heck could not they let this method return the dictionary being added to? Why?

Not only I could write

aLongAndComplicatedDictionaryName
    .Add("foo", foo)
    .Add("bar", bar);

but ... more importantly ... I would not have to jump through hoops as soon as I need to add one more key into a dictionary createdy by .ToDictionary() in the middle of a complex LINQ query.

Oh well.

Žádné komentáře:

Okomentovat