Server Migration
Tip: delegates in C#
One thing I am constantly forgetting is the syntax for delegates in C#. Fear not, although this is most probably going to be more of a reminder for myself, feel free to use it as a reference.
public string FindCulture(string cultureToFind) { return AcceptedCultures.Find(delegate(string s) { return s == cultureToFind; }); }
…at which point we can transform that into a lambda expression…
public string FindCulture(string cultureToFind) { return AcceptedCultures.Find(s => s == cultureToFind); }
Hopefully I won’t forget this syntax now…
Welcome to Tom Pearson
Thank you for taking the time to visit my blog! Take a second to peek around and check out some of my previous posts. Of course, I would love to find out what you think as well, so make sure to comment. See you around!



Others say…