Contents tagged with Linq

  • Setting a Default for FirstOrDefault

    Tags: Linq, C#

    The linq expression FirstOrDefault is nifty if you are trying to get the First value in a sequence and you don't want a pesky InvalidOperationException if there are no elements returned.   … more