I've just came across this great post at Bogdan Brinzarea’s blog.
The post contains plenty of links on each of the new features in the new framework.
Enjoy!
Back to Basics: JavaScript and Timezones
1 week ago
Thoughts about hmm... well... everything I guess
//
// Dear maintainer:
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning\
// to the next guy:
// total_hours_wasted_here = 16
//
NameValueCollection nvc = new NameValueCollection { { "a", "abc" }, { "b", "bcd" }, { "c", "cde" } };
public static class SampleExtensions
{
public static IEnumerable<KeyValuePair<string, string>> GetPairs(this NameValueCollection coll)
{
if (coll == null)
{
throw new ArgumentNullException("throw something here");
}
return coll.Cast<string>().Select(key => new KeyValuePair<string, string>(key, coll[key]));
}
}
var result = (from pair in nvc.GetPairs() where (string.Compare( pair.Value,"abc")==0) select pair.Key);
result.ToList<string>().ForEach(str => Console.WriteLine(str));